The TimerQueue manage a job heap sorted by job starting time. The object has it own control thread and sleep until the next job need to be started, then execute the job, delete it when it is done, and then fall asleep again. For periodic task the job can use repost to be automatically reposted at the end of the current execution. The approximate resolution of the queue is 1ms and to assure accuracy it recomended to only post short lived job. If a long tast needs to be started at a specific time, the TimerQueue object can be used to post the job to the job farm at a specific time.
typedef MuralU64 JobTime;
void post_job(TimerJobPtr new_job);
void cancel_job(TimerJobPtr old_job);
static JobTime now();
- now returns the current system time in millisecond.