Table of Contents

 
ChangeAlarm
 

Purpose

Changes the alarm relative to the old value

 

Protoype

void CTimerMngr::ChangeAlarm (string str_timer, int i_change)
 

Parameters

timer the ID of the timer to modify
change the number of milliseconds to change the alarm by
 

Description

This function changes the alarm by a given number of milliseconds relative from it's current set alarm. So if you want to reduce or increase a timer's alarm, you can use this function rather than polling for the current alarm and changing it with SetAlarm().

NOTE: The function will not let you reduce an alarm into the negative numbers. It will bottom out at 0.

 

Use

CTimerMngr timer;
// reduce the timer by 1 second
timer.ChangeAlarm("my_alarm", -1000);
// increase the alarm by 5 seconds
timer.ChangeAlarm("my_alarm", 5000);
 

Prev: Assign