Home > Backend Development > PHP Tutorial > Usage and description of PHP function microtime()_PHP tutorial

Usage and description of PHP function microtime()_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:18:12
Original
768 people have browsed it

Definition and Usage
The PHP function microtime() returns the current Unix timestamp and microseconds.
PHP function microtime() syntax
microtime(get_as_float)
PHP function microtime() parameters and description
get_as_float If the get_as_float parameter is given and its value is equivalent to TRUE, this function will return a Floating point number.
Note
The PHP function microtime() is only available under operating systems that support the gettimeofday() system call.
If called without optional parameters, this function returns a string in the format "msec sec", where sec is the number of seconds since the Unix epoch (0:00:00 January 1, 1970 GMT) , msec is the microsecond part. Both parts of the string are returned in seconds.
Example

Copy code The code is as follows:

echo (microtime()); //0.25139300 1138197510

The PHP function microtime() is usually used as follows:
Copy code The code is as follows:

$mtime= explode(' ',microtime());
$startTime=$mtime[1]+$mtime[0];     
echo $startTime; //1385976275.33

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/621699.htmlTechArticleDefinition and usage PHP function microtime() returns the current Unix timestamp and microseconds. PHP function microtime() syntax microtime(get_as_float) PHP function microtime() parameters and description get_as_float if...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template