4 ms·
Depending on your goals, using a deadline sleep (sleep_until in C++ parlance: https://en.cppreference.com/w/cpp/thread/sleep_until https://en.cppreference.com/w
by jepler 4y ago
Depending on your goals, using a deadline sleep (sleep_until in C++ parlance: https://en.cppreference.com/w/cpp/thread/sleep_until https://en.cppreference.com/w/cpp/thread/sleep_until) rather than a duration sleep (sleep_for) is beneficial
- signa11 4y agowell, sleep_until(…) will also drift based on vagaries of os scheduling etc. it would be (pleasantly) surprising iff it did not approximately exhibit the same behaviour as author’s first implementation.