PHP Class Elgg\Timer

Show file Open project: elgg/elgg

Public Methods

Method Description
begin ( array $keys ) : void Record the start time of a period
end ( array $keys ) : void Record the end time of a period
getTimes ( ) : array Get the tree of recorded start/end times
hasEnded ( array $keys ) : boolean Has the end of the period been recorded?

Private Methods

Method Description
getTreeNode ( array $keys ) : array Get a reference to the period array for the given keys

Method Details

begin() public method

Record the start time of a period
public begin ( array $keys ) : void
$keys array Keys to identify period. E.g. ['startup', __FUNCTION__]
return void

end() public method

Record the end time of a period
public end ( array $keys ) : void
$keys array Keys to identify period. E.g. ['startup', __FUNCTION__]
return void

getTimes() public method

Get the tree of recorded start/end times
public getTimes ( ) : array
return array

hasEnded() public method

Has the end of the period been recorded?
public hasEnded ( array $keys ) : boolean
$keys array Keys to identify period. E.g. ['startup', __FUNCTION__]
return boolean