rimas
rimas

Reputation: 757

Strange boost::this_thread::sleep behavior

I was trying to implement small time delays in multithreading code using boost::this_thread::sleep. Here is code example:

{
    boost::timer::auto_cpu_timer t;//just to check sleep interval
    boost::this_thread::sleep(boost::posix_time::milliseconds(25));
}

Output generated by auto_cpu_timer confused me little bit:

0.025242s wall, 0.010000s user + 0.020000s system = 0.030000s CPU (118.9%)

Why it 0.025242s but not 0.0025242s ?

Upvotes: 0

Views: 181

Answers (1)

Sven
Sven

Reputation: 22673

Because 25 milliseconds is 0.025 seconds; 0.0025 seconds would be 2.5 milliseconds.

Upvotes: 2

Related Questions