1. function microtime_float() 
  2.     //用空格分割microtime函数  
  3.     $_mtime = explode(" ", microtime()); 
  4.     //时间戳相加 
  5.     return $_mtime[1] + $_mtime[0]; 
  6.     /* 
  7.      * 或者 
  8.      list($usec, $sec) = explode(" ", microtime()); 
  9.      return $usec + $sec; 
  10.      *  
  11.      * */ 
  12.  
  13. //开始时间 
  14. $time_start = microtime_float(); 
  15. // 延时 
  16. usleep(100); 
  17.   
  18. //结束时间 
  19. $time_end = microtime_float(); 
  20.   
  21. //执行耗时=结束时间-开始时间 
  22. $time = $time_end - $time_start
  23.   
  24. echo $time ;