PHP Class Eloquent\Phony\Clock\SystemClock

Inheritance: implements Eloquent\Phony\Clock\Clock
Show file Open project: eloquent/phony Class Usage Examples

Public Methods

Method Description
__construct ( callable $microtime ) Construct a new system clock.
instance ( ) : Eloquent\Phony\Clock\Clock Get the static instance of this clock.
time ( ) : float Get the current time.

Method Details

__construct() public method

Construct a new system clock.
public __construct ( callable $microtime )
$microtime callable The implementation of microtime() to use.

instance() public static method

Get the static instance of this clock.
public static instance ( ) : Eloquent\Phony\Clock\Clock
return Eloquent\Phony\Clock\Clock The static clock.

time() public method

Get the current time.
public time ( ) : float
return float The current time.