PHP 클래스 XPSPL\idle\Time

The amount of time can be specified in seconds or milliseconds.
상속: extends XPSPL\Idle
파일 보기 프로젝트 열기: prggmr/xpspl 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_allow_override boolean When set to true the "override" method will be called otherwise the processor will signal a Idle_Function_Overflow.
$_idle_length integer Length of time to idle
$_instruction integer Time instruction type.
$_priority integer Priority of this idle function.
$_stop_time integer Time to stop the idle.

공개 메소드들

메소드 설명
__construct ( $time, $instruction ) Constructs the time idle.
convert_length ( integer | float $length, integer $to ) : integer | float Converts length of times from and to seconds, milliseconds and microseconds.
get_instruction ( ) : integer Returns the type of time.
get_length ( ) : integer Returns the length of time to idle.
get_time_left ( ) : integer | float Returns the amount of time left until the idle should stop.
get_time_until ( ) : integer Returns the length of time to idle until.
has_time_passed ( ) : boolean Determines if the time to idle until has passed.
idle ( Processor $processor ) : void Runs the idle function, this will call either sleep or usleep depending upon the type.
override ( object $time ) : boolean Determine if the given time idle function is less than the current.
set_time ( integer $time ) Sets the time.

메소드 상세

__construct() 공개 메소드

Constructs the time idle.
public __construct ( $time, $instruction )

convert_length() 공개 메소드

Converts length of times from and to seconds, milliseconds and microseconds.
public convert_length ( integer | float $length, integer $to ) : integer | float
$length integer | float
$to integer To instruction
리턴 integer | float

get_instruction() 공개 메소드

Returns the type of time.
public get_instruction ( ) : integer
리턴 integer

get_length() 공개 메소드

Returns the length of time to idle.
public get_length ( ) : integer
리턴 integer

get_time_left() 공개 메소드

Returns the amount of time left until the idle should stop.
public get_time_left ( ) : integer | float
리턴 integer | float

get_time_until() 공개 메소드

Returns the length of time to idle until.
public get_time_until ( ) : integer
리턴 integer

has_time_passed() 공개 메소드

Determines if the time to idle until has passed.
public has_time_passed ( ) : boolean
리턴 boolean

idle() 공개 메소드

Runs the idle function, this will call either sleep or usleep depending upon the type.
public idle ( Processor $processor ) : void
$processor XPSPL\Processor
리턴 void

override() 공개 메소드

Determine if the given time idle function is less than the current.
public override ( object $time ) : boolean
$time object Time idle object
리턴 boolean

set_time() 공개 메소드

Sets the time.
public set_time ( integer $time )
$time integer Length of time.

프로퍼티 상세

$_allow_override 보호되어 있는 프로퍼티

When set to true the "override" method will be called otherwise the processor will signal a Idle_Function_Overflow.
protected bool $_allow_override
리턴 boolean

$_idle_length 보호되어 있는 프로퍼티

Length of time to idle
protected int $_idle_length
리턴 integer

$_instruction 보호되어 있는 프로퍼티

Time instruction type.
protected int $_instruction
리턴 integer

$_priority 보호되어 있는 프로퍼티

Priority of this idle function.
protected int $_priority
리턴 integer

$_stop_time 보호되어 있는 프로퍼티

Time to stop the idle.
protected int $_stop_time
리턴 integer