您好,欢迎访问一九零五行业门户网

httpcreditcard.bankcomm.com PHP 一个页面执行时间类代码

核心代码
starttime=this->getmicrotime(); } function display()//显示页面执行的时间 { this->stoptime=this->getmicrotime(); this->spendtime=this->stoptime-this->starttime; return round(this->spendtime,10); } } /*调用方法 timer=new timer(); timer->start(); /*在此处放入你要执行的脚本或代码 for(i=0;i; } */ //echo 执行该代码花费时间.timer->display().秒; ?>

php检测每一段代码执行时间
process time: .$totaltime;}// 程序调用开始记时prostarttime();sleep(1); // sleep() 延时代码执行若干秒proendtime(); // 程序在每一段所消耗的执行时间sleep(2);proendtime();sleep(3);proendtime(); /************************************************* 华丽的分割线 **************************************************/// 实例2$t1 = microtime(true);sleep(3);$t2 = microtime(true);echo '程序耗时'.round($t2-$t1,3).'秒';?>
以上就介绍了httpcreditcard.bankcomm.com php 一个页面执行时间类代码,包括了httpcreditcard.bankcomm.com方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息