Boost logo

Boost Users :

Subject: Re: [Boost-users] Timer Callback
From: Andreas Wehrmann (a.wehrmann_at_[hidden])
Date: 2011-05-30 01:47:51


Quoting Niklas Angare <li51ckf02_at_[hidden]>:

> "Andreas Wehrmann" wrote:
>> On 05/26/2011 09:06 AM, asif saeed wrote:
>>> Can I use Boost Timer or Boost DateTime to trigger callbacks? I just
>>> want to be able to have the timer/date-time class trigger my handler
>>> functions after every 10 seconds for example or trigger a callback
>>> handling function after 25 seconds and die.
>>
>> you might want to take a look at the ASIO reference.
>> There you'll find the deadline_timer with which you can do exactly what
>> you want.
>
> deadline_timer from Asio is not a good choice for these scenarios
> since in won't work properly if the system time changes. See
> http://svn.boost.org/trac/boost/ticket/3504 (but beware of bad code
> in the attachments).
>
> Since the next version of Boost will contain
> boost::chrono::steady_clock, I'm hopeful that Asio will get a better
> timer.

Alright, I take it back then.
I wasn't aware of the fact that boost::asio::deadline_timer
are susceptible to time changes.

Regards,
Andreas

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net