[Ace-users] gettimeofday() and schedule

ScottReeve scott.reeve at verizon.net
Wed Aug 22 09:04:27 CDT 2007

I'm using the following code:

 ACE_Time_Value expireAt = timerQueue().gettimeofday () + delay;
 timerQueue().schedule(eventHandler, arg, expireAt);

The delay is set to 2 seconds.

So this works fine - the timer fires every two seconds and the routine
is called.

The problem is that when the system's time is changed to go backward
(with the "date" command in linux) the timer always has that much more
delay in it.  E.g: if I set the time back 30 seconds, the next
expiration will be 32 seconds, and then 2 after that.

Is there any routine I can call in ACE to do the same thing but have
it automatically adjust to the system clock's change - i.e. continue
expiring every two seconds if if the system's time is changed.


More information about the Ace-users mailing list