boost::timer is not a standard sleep

9 May
2007
9 May
'07
1:32 p.m.
I don't know why but the boost::timer does work well. Please, look at the following example bellow and if any idea let me know. #include <boost/timer.hpp> #include <iostream> #include <unistd.h> int main() { boost::timer timer; sleep(1); /* block until one second has elapsed */ std::cout << timer.elapsed() << std::endl; /* show the elapsed time (one second expected) */ return 0; } Though I am not sure I thing the timer just have in mind the time the processor was busy and not the time the application was running. Has the boost library any standard sleep(), I have heard boost::asio has a very good one. Thanks in advance.
6592
Age (days ago)
6592
Last active (days ago)
0 comments
1 participants
participants (1)
-
Yunior Peralta González