The boost::this_thread::sleep() examples seem to use boost::posix_time::milliseconds objects. I tried this and it works, but I use boost::chrono to check the system clock, etc. It seems to me that I should go through sleep() a chrono::duration as follows:
boost :: this_thread :: sleep (boost :: chrono :: duration (10));
But the compiler tells 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'
What I find embarrassed. Am I right in thinking that I can do this? Will it be necessary to convert to posix_time ?
c ++ chrono boost-thread
2NinerRomeo
source share