unregister a single timer listening

This commit is contained in:
kremsy 2014-03-19 12:34:25 +01:00 committed by Steffen Schröder
parent 1386e00ce3
commit 57375a6e8b

View File

@ -34,6 +34,22 @@ class TimerManager {
$this->registerTimerListening($listener, $method, $time, true);
}
/**
* Unregisters a Timer Listening
* @param TimerListener $listener
* @param $method
* @return bool
*/
public function unregisterTimerListening(TimerListener $listener, $method){
foreach($this->timerListenings as $key => $listening){
if($listening->listener == $listener && $listening->method == $method){
unset($this->timerListenings[$key]);
return true;
}
}
return false;
}
/**
* Registers a Timing Listening, note < 10ms it can get inaccurate
*