Also, wouldn't the function call itself have an overhead? If yes, is there a way to get around it ?


On Tue, Sep 9, 2008 at 5:10 PM, Igor R <boost.lists@gmail.com> wrote:
>   void print1()
>   {
>     if (count_ < 100)
>     {
>       timer1_.expires_at(timer1_.expires_at() +
> boost::posix_time::microseconds(10));
>       timer1_.async_wait(boost::bind(&printer::print1, this));
>       std::cout << "Timer 1: " << count_ << "\n";
>       ++count_;
>
>     }
>

> Over a period of time I think it will probably cause some slippage.

This is because you always take a new "reference time".
I guess that if you store the initial reference-point (when starting
the timer for the 1st time) and then always add to *it* a
time_duration*iterationNumber, then the slippage wouldn't accumulate.
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users



--
-------------------------------------------------------------------
Ph : (732) 647 5679
Email: khandelwal.amit@gmail.com
Web: http://khandelwal.amit.googlepages.com/home
-------------------------------------------------------------------