定时器新增addTimer重载函数,默认时间间隔为20毫秒

This commit is contained in:
Nomango 2017-10-09 00:58:23 +08:00
parent 0d2e89af32
commit 282fc1bc38
2 changed files with 7 additions and 0 deletions

View File

@ -114,6 +114,11 @@ void Timer::addTimer(Timer * timer)
s_vTimers.push_back(timer);
}
void Timer::addTimer(TString name, const TIMER_CALLBACK & callback)
{
addTimer(name, 20, callback);
}
void Timer::addTimer(TString name, UINT ms, const TIMER_CALLBACK & callback)
{
// 创建定时器

View File

@ -1487,6 +1487,8 @@ public:
// 添加定时器
static void addTimer(Timer * timer);
// 添加定时器
static void addTimer(TString name, const TIMER_CALLBACK & callback);
// 添加定时器
static void addTimer(TString name, UINT ms, const TIMER_CALLBACK & callback);
// 启动特定定时器
static void startTimer(TString name);