timer utility More...
#include "ZFTimer.h"
Go to the source code of this file.
Functions | |
void | ZFGlobalTimerAttach (const ZFListener &timerCallback, ZFLevel observerLevel=(ZFLevelAppNormal)) |
global timer util | |
void | ZFGlobalTimerAttachOnce (const ZFListener &timerCallback, ZFLevel observerLevel=(ZFLevelAppNormal)) |
see ZFGlobalTimerAttach | |
void | ZFGlobalTimerDetach (const ZFListener &timerCallback) |
see ZFGlobalTimerAttach | |
void | ZFGlobalTimerDetachAll () |
see ZFGlobalTimerAttach | |
zftimet const & | ZFGlobalTimerIntervalDefault () |
see ZFGlobalTimerAttach | |
void | ZFGlobalTimerIntervalDefault (zftimet const &intervalDefault) |
see ZFGlobalTimerAttach | |
zftimet const & | ZFGlobalTimerInterval () |
see ZFGlobalTimerAttach | |
void | ZFGlobalTimerInterval (zftimet const &interval) |
see ZFGlobalTimerAttach | |
void | ZFGlobalTimerManualStep () |
manual control global timer step | |
void | ZFGlobalTimerManualStepCancel () |
see ZFGlobalTimerManualStep | |
timer utility
|
extern |
global timer util
you can attach any callbacks to same global timer instance, the global timer would be running if more than one timer callback attached, and would be stopped when all of them detached
you can change timer interval by ZFGlobalTimerInterval even when it's running
a typical advanced usage for global timer:
you may also use ZFGlobalTimerManualStep to manually control the timer steps
note global timer is ensured run in main thread
|
extern |
manual control global timer step
once called, all task attached to ZFGlobalTimerAttach would not be notified unless called this method again, you may cancel the manual step and restore to original timer logic by ZFGlobalTimerManualStep