Re: Timeout timers in an application
- From: Rainer Weikusat <rweikusat@xxxxxxxxxxx>
- Date: Tue, 22 Jan 2008 12:16:38 +0100
David Schwartz <davids@xxxxxxxxxxxxx> writes:
On Jan 18, 9:27 am, "Ed J" <j...@xxxxxxxxxxx> wrote:
How can I implement a timeout timer in an application such that it wouldn't
be subject to a time-of-day clock adjustment? My current implementation
uses time(), etc., but since they are based on the time-of-day clock, my
code breaks if the system clock is set or adjusted while a timeout is
pending.
[...]
Generally, if you want to set a timer for 15 seconds from now,
you track that as being when the system uptime is 15 seconds more
than it was when the timer was set.
The kernel already does that for everybody who may need this. The
interfaces would be alarm or setitimer for higher resolutions.
.
- References:
- Timeout timers in an application
- From: Ed J
- Re: Timeout timers in an application
- From: David Schwartz
- Timeout timers in an application
- Prev by Date: Re: RS232 Redirector Program in C using Linux
- Next by Date: Re: python-xlib question
- Previous by thread: Re: Timeout timers in an application
- Next by thread: Processing files larger than 2.2GB.
- Index(es):
Relevant Pages
|