PHP Class Ubench

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Show file Open project: timetoogo/penumbra Class Usage Examples

Protected Properties

Property Type Description
$end_time
$memory_usage
$start_time

Public Methods

Method Description
end ( ) : void Sets end microtime
getMemoryPeak ( $raw = false, string $format = null ) : string | float Returns the memory peak, readable or not
getMemoryUsage ( $raw = false, string $format = null ) : string | float Returns the memory usage at the end checkpoint
getTime ( $raw = false, string $format = null ) : string | float Returns the elapsed time, readable or not
readableElapsedTime ( float $microtime, string $format = null, $round = 3 ) : string Returns a human readable elapsed time
readableSize ( integer $size, string $format = null, integer $round = 3 ) : string Returns a human readable memory size
start ( ) : void Sets start microtime

Method Details

end() public method

Sets end microtime
public end ( ) : void
return void

getMemoryPeak() public method

Returns the memory peak, readable or not
public getMemoryPeak ( $raw = false, string $format = null ) : string | float
$format string The format to display (printf format)
return string | float

getMemoryUsage() public method

Returns the memory usage at the end checkpoint
public getMemoryUsage ( $raw = false, string $format = null ) : string | float
$format string The format to display (printf format)
return string | float

getTime() public method

Returns the elapsed time, readable or not
public getTime ( $raw = false, string $format = null ) : string | float
$format string The format to display (printf format)
return string | float

readableElapsedTime() public static method

Returns a human readable elapsed time
public static readableElapsedTime ( float $microtime, string $format = null, $round = 3 ) : string
$microtime float
$format string The format to display (printf format)
return string

readableSize() public static method

Returns a human readable memory size
public static readableSize ( integer $size, string $format = null, integer $round = 3 ) : string
$size integer
$format string The format to display (printf format)
$round integer
return string

start() public method

Sets start microtime
public start ( ) : void
return void

Property Details

$end_time protected property

protected $end_time

$memory_usage protected property

protected $memory_usage

$start_time protected property

protected $start_time