c++ - implement waiting timer using only the standard library -


what standard c++ ways exist implement waiting timer? is, code trigger timer callback , , wait timeout occur (not waste any, or little, cpu cycles). there must finite number of ways std::. using <thread> , timeout feature of condition variables. seems wasteful have spawn thread each timer.

std::this_thread::sleep_for() , std::this_thread::sleep_until() useful unless you're spawning new thread, cannot other work @ same time.


Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -