Re: Best way to implement a resettable timer.
From: Darko M. (mdanko_at_tesla.rcub.bg.ac.yu)
Date: 05/31/04
- Next message: Lew Pitcher: "Re: Calling a Windows DLL"
- Previous message: Bjorn Reese: "Re: Tutorial and guidelines: A proposal for better OpenSource code (long message)"
- In reply to: Barry Margolin: "Re: Best way to implement a resettable timer."
- Next in thread: David Schwartz: "Re: Best way to implement a resettable timer."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 May 2004 03:31:23 -0700
Barry Margolin <barmar@alum.mit.edu> wrote in message news:<barmar-8C2C0A.12272827052004@comcast.dca.giganews.com>...
> In article <xKudnSWVeor1livdRVn_vQ@giganews.com>,
> RJGraham <null@null.com> wrote:
>
> > What's the best way to to implement a resettable timer, kind of like a
> > watchdog timer that can be reset.
> >
> > I want to be able to start a timer to wait on an event, and either
> > timeout, or reset the timer to wait on the next event. The idea here is
> > to detect timeouts in my application.
>
Use selectwith all fd set-pointers set to NULL and the timeout to the
corresponding value. This works quite good. You don't need any file
descriptors, and you have the higher precision. If you want to stop
it, just interrupt it by a signal (eg. SIGUSR1)
- Next message: Lew Pitcher: "Re: Calling a Windows DLL"
- Previous message: Bjorn Reese: "Re: Tutorial and guidelines: A proposal for better OpenSource code (long message)"
- In reply to: Barry Margolin: "Re: Best way to implement a resettable timer."
- Next in thread: David Schwartz: "Re: Best way to implement a resettable timer."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|