0

I have a boost::asio::steady_timer which is set for millisecond precision. Usually, it's about 40-70ms, value may vary. Time is set in a loop. The thread that owns timer's io_service may get quite busy processing other tasks. What I see in my code - sometimes timer is fired 250-300ms later than it should. Is such an offset can be reasonable?

It' on OS X 10.10.4

peetonn
  • 2,942
  • 4
  • 32
  • 49

1 Answers1

0

It depends a lot on the circumstances (how are the threads being scheduled, what load is the system under etc.)

At face value, I'd say >20ms is a bit much, but there is not a lot of guarantee to be had unless you have a real-time OS and tightly control the environment.

See also:

Community
  • 1
  • 1
sehe
  • 374,641
  • 47
  • 450
  • 633