There will always be a delay between measurement and observation, 5-6 ms does feel a bit high for the functions you’re calling. I’d time the execution of the functions you’re calling, averaged over many runs, to see if there is a bottleneck somewhere. I’d also check to make sure that your optimization level is 2 or 3. WL
On Jun 20, 2022, at 4:00 AM, Daggumati, Rajesh via Boost
wrote: Hi Team, When I use boost sleep function, I am getting delayed response. How to overcome this issue. Is there any alternative for this?
boost::posix_time::ptime t1 = boost::posix_time::microsec_clock::local_time(); boost::this_thread::sleep(boost::posix_time::millisec(10000)); boost::posix_time::ptime t2 = boost::posix_time::microsec_clock::local_time(); boost::this_thread::sleep(boost::posix_time::millisec(10000)); boost::posix_time::ptime t3 = boost::posix_time::microsec_clock::local_time(); boost::posix_time::time_duration diff = t2 - t1; std::cout << diff.total_milliseconds() << std::endl; boost::posix_time::time_duration diff1 = t3 - t2; std::cout << diff1.total_milliseconds() << std::endl;
output is : 10005 10006
Expected ouput should be 10000 and 10000
Regards, Rajesh D Please be advised that this email may contain confidential information. If you are not the intended recipient, please notify us by email by replying to the sender and delete this message. The sender disclaims that the content of this email constitutes an offer to enter into, or the acceptance of, any agreement; provided that the foregoing does not invalidate the binding effect of any digital or other electronic reproduction of a manual signature that is included in any attachment.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost