Examples of boost::this_thread::sleep()
seem to use objects of boost::posix_time::milliseconds
. I've tried that and it works, but I am using boost::chrono
for checking the system clock etcetera. It seems to me I should be able to pass sleep()
a chrono::duration
like this:
boost::this_thread::sleep( boost::chrono::duration(10) );
But the compiler is giving me the following error:
... boost_1_49_0\boost/thread/win32/thread_data.hpp(171) : error C2039: 'total_milliseconds' : is not a member of 'boost::chrono::duration'
Which I find confusing. Am I right in thinking I should be able to do this? Will it be necessary to convert to a posix_time
?