Lots of ways to flay that feline. Look at setitimer and getitimer.
Also, for really crude stuff, look at the alarm system call. You can use
it by maybe setting your timer for something in the decade range and then
calling alarm whenever you want. The return will give you the time
remaining.
--
-Time flies like the wind. Fruit flies like a banana. Stranger things have -
-happened but none stranger than this. Does your driver's license say Organ
-Donor?Black holes are where God divided by zero. Listen to me! We are all-
-individuals! What if this weren't a hypothetical question? [EMAIL PROTECTED]
On Mon, 30 Jul 2001, Cole Tuininga wrote:
=>
=>Sorry for the OT post - thought the code I'm writing IS intended to
=>be run on linux boxen here. *grin*
=>
=>I'm working on a generic network based lock server. The problem I'm
=>running into is in regards to timing. In my first iteration of the
=>server, it based timings on wallclock time ( a literal read from the
=>time(2) call ). However, this isn't sufficient for my purposes in that
=>if a system clock gets "off" and then is reset, it could skew the
=>timing of what the server has to do.
=>
=>What I'm looking for is a way to be able to have a running timer that I
=>can poll at my leisure for time comparisons. I'd prefer to stick to
=>plain 'ole POSIXish C rather than pulling in 3rd party libraries ( for
=>instance, I know that glib has a GTimer mechanism) but I don't know
=>enough about this stuff to pull it off.
=>
=>Anybody have pointers to things to look at?
=>
=>If this didn't make sense or people need clarifications, please feel
=>free to ask...
=>
=>
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************