定时器新增addTimer重载函数,默认时间间隔为20毫秒
This commit is contained in:
		
							parent
							
								
									0d2e89af32
								
							
						
					
					
						commit
						282fc1bc38
					
				|  | @ -114,6 +114,11 @@ void Timer::addTimer(Timer * timer) | ||||||
| 	s_vTimers.push_back(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) | void Timer::addTimer(TString name, UINT ms, const TIMER_CALLBACK & callback) | ||||||
| { | { | ||||||
| 	// 创建定时器
 | 	// 创建定时器
 | ||||||
|  |  | ||||||
|  | @ -1487,6 +1487,8 @@ public: | ||||||
| 	// 添加定时器
 | 	// 添加定时器
 | ||||||
| 	static void addTimer(Timer * timer); | 	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 addTimer(TString name, UINT ms, const TIMER_CALLBACK & callback); | ||||||
| 	// 启动特定定时器
 | 	// 启动特定定时器
 | ||||||
| 	static void startTimer(TString name); | 	static void startTimer(TString name); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue