PHP Class FOF30\Timer\Timer

Afficher le fichier Open project: akeeba/fof Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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
Résultat Timer

__wakeup() public méthode

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

getRunningTime() public méthode

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

getTimeLeft() public méthode

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

resetTime() public méthode

Reset the timer
public resetTime ( ) : void
Résultat void