HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

hrtime

Description

The hrtime of Miscellaneous for PHP get the system's high resolution time.

Syntax

hrtime(
    bool $as_number = false
): array|int|float|false

Parameters

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 as_number is false. Otherwise the nanoseconds are returned as int (64bit platforms) or float (32bit platforms). Returns false on failure.

Examples

1 · void

<?

$return = hrtime();

print_r($return);
Array
(
    [0] => 9075767
    [1] => 587584612
)

2 · as_number · false

<?

$as_number = false;

$return = hrtime($as_number);

print_r($return);
Array
(
    [0] => 9075768
    [1] => 991225512
)

3 · as_number · true

<?

$as_number = true;

$return = hrtime($as_number);

echo $return;
9075770166161665