Reputation: 64356
I have a function which should be called with an interval of 0.5 seconds in its own thread.
Is there a feature in boost or another library which allows to connect a timer which works in callback-like mode and runs callback for a given time interval?
Upvotes: 2
Views: 1617
Reputation: 2349
sounds more like you want a repeating timer with a callback
you can normally do this with boost and binding...here is a good walk though
http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tuttimer3.html
Upvotes: 0
Reputation: 16193
I use JUCE for timers. It allows you to subclass the timer class using multiple inheritance, set a timer running, and then define a callback function to handle the timer events extremely easily.
http://www.rawmaterialsoftware.com/
There are probably many libs that offer similar functionality.
Upvotes: 2