Re: Best way to implement a resettable timer.

From: Darko M. (mdanko_at_tesla.rcub.bg.ac.yu)
Date: 05/31/04


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)



Relevant Pages

  • Power manager problem Hive
    ... Before going to autosuspend I always get a reset of the ... 'SystemActivity' timer. ... FATFS!ReadStreamBuffer: begin findbuffer ... begin entercritsec ...
    (microsoft.public.windowsce.platbuilder)
  • RE: Power manager problem Hive
    ... > Before going to autosuspend I always get a reset of the ... > 'SystemActivity' timer. ... > FATFS!ReadStreamBuffer: begin findbuffer ... > begin entercritsec ...
    (microsoft.public.windowsce.platbuilder)
  • Re: synthesizing rightof or succ
    ... process (clock, reset) ... variable timer, next_timer: unsigned; ... state <= t31; ... DOULOS - Developing Design Know-how ...
    (comp.lang.vhdl)
  • Re: Changing the Resuming state while password screen is shown
    ... To keep device awake enter unattended mode and reset the idle ... reset the idle timer or/and enter the unattended mode. ...
    (microsoft.public.pocketpc.developer)
  • Re: Help designing an reset hourly timer... 555??
    ... > I have a number of network unreliable network appliances scattered out ... The hourly pulse should be 'astable', i.e. i'd like it to occur ... > the reset switch. ... Use one timer as a clock ...
    (sci.electronics.design)