PHP Class FOF30\Timer\Timer

Show file Open project: akeeba/fof Class Usage Examples

Public Methods

Method Description
__construct ( integer $max_exec_time = 5, integer $runtime_bias = 75 ) : Timer Public constructor, creates the timer object and calculates the execution time limits.
__wakeup ( ) : void Wake-up function to reset internal timer when we get unserialized
getRunningTime ( ) : float Gets the time elapsed since object creation/unserialization, effectively how long this step is running
getTimeLeft ( ) : float Gets the number of seconds left, before we hit the "must break" threshold
resetTime ( ) : void Reset the timer

Method Details

__construct() public method

Public constructor, creates the timer object and calculates the execution time limits.
public __construct ( integer $max_exec_time = 5, integer $runtime_bias = 75 ) : Timer
$max_exec_time integer Maximum execution time, in seconds
$runtime_bias integer Runtime bias factor, as percent points of the max execution time
return Timer

__wakeup() public method

Wake-up function to reset internal timer when we get unserialized
public __wakeup ( ) : void
return void

getRunningTime() public method

Gets the time elapsed since object creation/unserialization, effectively how long this step is running
public getRunningTime ( ) : float
return float

getTimeLeft() public method

Gets the number of seconds left, before we hit the "must break" threshold
public getTimeLeft ( ) : float
return float

resetTime() public method

Reset the timer
public resetTime ( ) : void
return void