Table of Contents

 
AddTimer
 

Purpose

Adds a timer to the manager

 

Protoype

void CTimerMngr::AddTimer (string str_id, int i_alarm, bool b_start = false, int i_ID = 0)
 

Parameters

id the unique ID of the timer
alarm the alarm in milliseconds
start whether to start the timer upon creation
ID the timer ID used for specific mass removal
 

Description

This function adds a new timer to the manager. Each new timer must have a unique string ID in order for it to be referenced later in the program. The alarm is set in milliseconds, and specifies the amount of elapsed time until the timer is considered spent. All timers count up, not down. If you want to start the timer immediately after it created and save yourself a function call, pass in TRUE for b_start. The last parameter is better exaplined in RemoveAll().

 

Use

CTimerMngr timer;
timer.AddTimer("my_timer", 5000, false, OBJECT_ID);
 

Prev: Table of Contents
Next: Assign