• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

php 代码运行时间查看类 - 圣者

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

php 代码运行时间查看类

简介:这是php 代码运行时间查看类的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

class=\'pingjiaF\' frameborder=\'0\' src=\'http://biancheng.dnbcw.info/pingjia.php?id=342965\' scrolling=\'no\'>
<?php  
//author:zhoujian
//date:2011-08-05
class RunTime//页面执行时间类 
{ 
	private $starttime;//页面开始执行时间 
	private $stoptime;//页面结束执行时间 
	private $spendtime;//页面执行花费时间 
	function getmicrotime()//获取返回当前微秒数的浮点数 
	{ 
		list($usec,$sec)=explode(" ",microtime()); 
		return ((float)$usec + (float)$sec); 
	} 
	function start()//页面开始执行函数,返回开始页面执行的时间 
	{ 
		$this->starttime=$this->getmicrotime(); 
	} 
	function end()//显示页面执行的时间 
	{ 
		$this->stoptime=$this->getmicrotime(); 
		$this->spendtime=$this->stoptime-$this->starttime; 
		//return round($this->spendtime,10); 
	} 
	function display()
	{
	    //$this->end();
	    echo "<p>运行时间:".round($this->spendtime,10)."秒</p>";
	}
} 
/*调用方法   
$timer=new Runtime(); 
$timer->start();  
//运行代码
$timer->end();
$timer->display();
*/
?>
 

  

爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

http://biancheng.dnbcw.info/php/342965.html pageNo:6

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
ajax处理php返回json数据例子发布时间:2022-07-10
下一篇:
PHP日历签到模块发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap