Current Location: Home> Function Categories> hrtime

hrtime

Obtain the system's high-precision time
Name:hrtime
Category:Miscellaneous
Programming Language:php
One-line Description:Returns the system's high resolution time.

Definition and usage

hrtime() function returns the high resolution time of the system.

This time is often used for performance measurements because it provides higher precision than conventional time functions such as time().

Example

Return to the system's high resolution time:

 < html >
< body >
<?php
echo hrtime ( true ) , PHP_EOL ;
print_r ( hrtime ( ) ) ;
?>
</ body >
</ html >

The output of the above code might look like this:

 749040731418900
Array
(
    [ 0 ] => 749040
    [ 1 ] => 731419500
)

grammar

 hrtime ( return_as_num )
parameter describe
return_as_num

Optional. The default is FALSE.

When false, the integer array is returned in the format [seconds, nanoseconds].

When true, return NSE (int (64-bit platform) or float (32-bit platform)).

Similar Functions
Popular Articles