PHP Класс FOF30\Timer\Timer

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

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
Результат Timer

__wakeup() публичный Метод

Wake-up function to reset internal timer when we get unserialized
public __wakeup ( ) : void
Результат void

getRunningTime() публичный Метод

Gets the time elapsed since object creation/unserialization, effectively how long this step is running
public getRunningTime ( ) : float
Результат float

getTimeLeft() публичный Метод

Gets the number of seconds left, before we hit the "must break" threshold
public getTimeLeft ( ) : float
Результат float

resetTime() публичный Метод

Reset the timer
public resetTime ( ) : void
Результат void