[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: $SECONDS and timeout values use realtime `gettimeofday()`

From: Chet Ramey
Subject: Re: $SECONDS and timeout values use realtime `gettimeofday()`
Date: Wed, 29 Mar 2023 10:49:00 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 3/24/23 6:19 PM, William Kennington wrote:
Not worried, it is legitimately a problem for us to the point we are currently patching bash to use the monotonic clock for seconds. It times out stuff in our boot process which executes normally after the time sync has completed and jumped the clock forward. Rght now, we are just patching bash until we can fix all of our uses of $SECONDS. I don't really have a preference for how this gets exposed (updating SECONDS to use the monotonic timer, adding a new variable like MONOSECONDS, or some other call to get monotonic time via clock_gettime).

Interesting. I was wondering how you got onto this, so I looked around for
any utilities (e.g., timeout, sleep), library functions, or system calls
that use the monotonic clock and couldn't find any. It must be too `new';
everyone seems to use the realtime clock.

I'll take it as a feature request.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]