September 2001
Intermediate to advanced
768 pages
32h 45m
English
int microtime(void)
Returns the microsecond value for the current time.
Returns:
String containing microseconds and seconds
Description:
Gives the microseconds component of the current time. The string returned from this function is made of up the number of microseconds followed by the UNIX epoch time. To perform calculations on this function, you process the output to obtain an actual number. Another option would be to use gettimeofday() to obtain the microseconds component of the current time.
This function can be useful for simple benchmarking. By timing the start and finish of a process in your script, you can determine where the script may require optimization.
Version:
PHP 3, PHP 4
See also:
gettimeofday()
Example:
Read now
Unlock full access