Menu Home

hrtime

osbo.com | PHP | Functions | hrtime

Get the system's high resolution time

Syntax

hrtime ( [ bool $get_as_number = FALSE ] ) : mixed

Parameters

get_as_number

Whether the high resolution time should be returned as array or number.

Return

Returns an array of integers in the form [seconds, nanoseconds], if the parameter get_as_number is false. Otherwise the nanoseconds are returned as integer (64bit platforms) or float (32bit platforms).

Examples

void

<?

$array = hrtime();
print_r($array);

?>
Array
(
    [0] => 355636
    [1] => 220671902
)

get_as_number

<?

$get_as_number = true;
$number = hrtime($get_as_number);
echo $number;

?>
355636249323211

PHP