php计算程序执行时间
(2012-05-11 10:24:01)
标签:
php计算程序时间it |
分类: php那些事 |
- <?php
- $stime=microtime(true); //获取程序开始执行的时间
-
echo "hello world";
//你执行的代码 - $etime=microtime(true);//获取程序执行结束的时间
-
$total=$etime-$stime;
//计算差值 - echo "<br />{$total} times";
- ?>
前一篇:php中的curl的使用(五)
后一篇:NoSQL数据库笔谈