当前位置: 首页 > 网络学院 > 服务端脚本教程 > PHP > microtime() 函数

PHP
PHP 安全邮件
MySQL 介绍
连接 MySQL
创建 MySQL
MySQL 插入记录
MySQL 选择记录
MySQL Where
MySQL Order By
MySQL 记录更新
MySQL 删除记录
PHP ODBC
XML Expat Parser
XML SimpleXML
PHP 数组参考
PHP Calendar
PHP Date
PHP Directory
PHP Filesystem
PHP FTP
PHP HTTP

PHP 中的 microtime() 函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 553 ::
收藏到网摘: n/a

Definition and Usage
定一个用法

The microtime() function returns the current Unix timestamp with microseconds.
microtime()函数的作用是:返回当前Unix时间戳和微秒数(百万分之一秒)。

Syntax
语法

microtime(get_as_float)

Parameter参数 Description描述
get_as_float Optional. When set to true it specifies that the function should return a float, instead of a string
可选参数。如果该参数设置为True,则该函数以浮点数字的形式返回值,否则以字符串形式返回值


Tips and Notes
注意

Note: This function returns the string "microsec sec", where sec is the number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and microsec is the microseconds part. Notice that both parts are returned in units of seconds.
注意点:这个函数返回字符串“microsec sec”,sec是指Unix Epoch(1970年1月1日0:00:00)开始计算所经过的秒数,microsec只是表示其微秒的部分。上述二者都将以“秒”为单位返回。

Note: The get_as_float parameter was added to PHP 5!
注意点:get_as_float仅在PHP 5以上版本中支持。


Example
案例

<?php
echo(microtime());
?>

The output of the code above could be:
上述代码将输出下面的结果:

0.25139300 1138197510

评论 (0) All

登陆 | 还没注册?