Timer class

Does anybody have a C++ version of java's swing timer class (or provide guidance on creating one)?
(If you don't know what that is, it basically takes a delay in milliseconds and a series of ActionListener objects. Every time that delay passes after the timer is started by a member function, the timer activates the listeners and causes them to perform some assocated code.)
Something like this?
1. Create object and pass callback and time delay to object.
2. Constructor creates new thread for an internal function to loop.
3. Inside the loop there's a delay (preferably, one that yields CPU time) and a call to the callback.
Those are the two things I'm not sure about - per-millisecond time control functions and thread management. (In the swing timer all the objects connect to one thread simultaneously to prevent massive program time-tracking overload.)
Topic archived. No new replies allowed.