Is there a nice easy multi-platform C ++ timer queue?

What I'm looking for is a simple timer queue, possibly with an external clock source and polling method (so it will be multi-platform). Each linked message can be an object that implements a simple interface with the virtual onTimer()member function .

+3
source share
3 answers

Boost::ASIOcontains an asynchronous timer implementation. This might work for you.

+4
source

There is a good article in CodeProject here that describes the various timers available on Windows and has chapters called "Queue Timers" and "Make Your Own Timer."

#ifdef -- #endif. , .

+2

It does not meet all your criteria, but ... I wrote a series of blog posts about the timer queue for windows, which is implemented from the point of view of an external time provider, and which is either polled or controlled by a flow, The series comes with source code and tests, and the purpose of this was to demonstrate testing fairly complex code. Anyway, you can use some of the codes or ideas if no one comes up better.

Articles start here: http://www.lenholgate.com/archives/000306.html

0
source

Source: https://habr.com/ru/post/1697455/


All Articles