终于找出输出实践错误的地方了

原来关于$mtime的定义没加,我说怎么一下就是1000W秒 ;-)

PHP:
  1. <?php
  2. error_reporting(E_ERROR | E_WARNING | E_PARSE);
  3. header("Content-Type: text/html; charset=gb2312");
  4. $starttime = $mtime[1] + $mtime[0];
  5. function gettimeout(){
  6.                 GLOBAL $starttime;
  7.  
  8.                 $mtime = explode(" ", microtime());
  9.                 $endtime = $mtime[1] + $mtime[0];
  10.                 $totaltime = ($endtime - $starttime);
  11.                 $totaltime = number_format($totaltime, 7);
  12.                 $debuginfo = "Processed in $totaltime second(s)";
  13.                 return $debuginfo;
  14.         }
  15.  
  16.  
  17. ?>
  18. <span style="font-size: 7pt; color:#333333"><?=gettimeout()?></></span>

相关文章:
  • No related posts
  • Leave a Reply