// 获得微妙方法
function getMillisecond()
{
list($s1, $s2) = explode(' ', microtime());
return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);
}

原理:分别记录函数开始时间和结束时间,然后时间差就是函数执行的时间


 <?php
$start_time = microtime(true); for($i=1;$i<=1000;$i++){ echo $i.'<br>';
} $end_time = microtime(true); echo '循环执行时间为:'.($end_time-$start_time).' s';
?>

最新文章

  1. (四)SQL入门 数据库的操作与事务管理
  2. python(14)类,方法,对象,实例
  3. hadoop配置优化
  4. ios Swift 算法
  5. K最近邻算法
  6. linux下使用split 来分割大文件
  7. 手机摇一摇效果-html5
  8. The JRE could not be found.Edit the server and change the JRE location.
  9. javascript必知必会之prototype
  10. 基于visual Studio2013解决面试题之0707最小元素
  11. uva11991 Easy Problem from Rujia Liu?
  12. Tornado 网站demo 二
  13. Ubuntu 16.04开启SSH服务
  14. java基础学习周计划之2--面向对象
  15. jquery快速入门(一)
  16. CSS盒模型(Box Model)
  17. 背水一战 Windows 10 (104) - 通知(Toast): 纯文本 toast, 短时 toast, 长时 toast, 图文 toast
  18. es6 语法 (Decorator)
  19. strut2 的数据验证
  20. PPTP 在Centos 7.1 建立方法与失效处理

热门文章

  1. Python文章推荐1
  2. 17 rest-framework框架的基本组件
  3. [原]sencha touch之表单二(注册页面)
  4. static关键字什么意思?Java中是否可以覆盖一个private或者是static的方法?
  5. quartz 动态更改执行时间
  6. Pascal小游戏 不要消灭星星
  7. Entity Framework(四)--EF原理和状态管理
  8. centos6系列问题
  9. sshd_config_for_centos
  10. KMS激活windows