\Ubench

Summary

Methods
Properties
Constants
start()
end()
getTime()
getMemoryUsage()
getMemoryPeak()
run()
readableSize()
readableElapsedTime()
hasEnded()
hasStarted()
No public properties found
No constants found
No protected methods found
$start_time
$end_time
$memory_usage
N/A
No private methods found
No private properties found
N/A

Properties

$start_time

$start_time : float

Type

float

$end_time

$end_time : float

Type

float

$memory_usage

$memory_usage : 

Type

Methods

start()

start() : void

Sets start microtime

end()

end() : void

Sets end microtime

Throws

\Exception

getTime()

getTime(boolean  $raw = false, string  $format = null) : float|string

Returns the elapsed time, readable or not

Parameters

boolean $raw
string $format

The format to display (printf format)

Throws

\Exception

Returns

float|string

getMemoryUsage()

getMemoryUsage(  $raw = false, string  $format = null) : string|float

Returns the memory usage at the end checkpoint

Parameters

$raw
string $format

The format to display (printf format)

Returns

string|float

getMemoryPeak()

getMemoryPeak(  $raw = false, string  $format = null) : string|float

Returns the memory peak, readable or not

Parameters

$raw
string $format

The format to display (printf format)

Returns

string|float

run()

run(callable  $callable) : mixed

Wraps a callable with start() and end() calls

Additional arguments passed to this method will be passed to the callable.

Parameters

callable $callable

Returns

mixed

readableSize()

readableSize(integer  $size, string  $format = null, integer  $round = 3) : string

Returns a human readable memory size

Parameters

integer $size
string $format

The format to display (printf format)

integer $round

Returns

string

readableElapsedTime()

readableElapsedTime(float  $microtime, string  $format = null,   $round = 3) : string

Returns a human readable elapsed time

Parameters

float $microtime
string $format

The format to display (printf format)

$round

Returns

string

hasEnded()

hasEnded() 

hasStarted()

hasStarted()