mardi 2 juillet 2019

Are there any way to replace Windows API Timer (SetTimer) with native C++ code?

I only know there is a deadline_timer in boost. If there isn't a more native C++ code, I'll have to use the boost one.

// Construct a timer without setting an expiry time.
boost::asio::deadline_timer timer(io_context);

// Set an expiry time relative to now.
timer.expires_from_now(boost::posix_time::seconds(5));

// Wait for the timer to expire.
timer.wait()

Aucun commentaire:

Enregistrer un commentaire