如何用php获取程序执行的时间

yipeiwu_com6年前PHP代码库
在head.htm中加入,也就是在默认模版中添加“$stime=microtime(true); //获取程序开始执行的时间”
复制代码 代码如下:

<!--<?php
$stime=microtime(true); //获取程序开始执行的时间
$GuideFid[$fid]=str_replace("<a href='$webdb[www_url]' class='guide_menu'>>首页</a>","",$GuideFid[$fid]);
$fupId=intval($fupId);
$topMenu[$fupId]='ck';
print <<<EOT
-->

这里是网页
再在foot.htm修改如:
复制代码 代码如下:

<!--
EOT;
$etime=microtime(true);//获取程序执行结束的时间
$total=$etime-$stime;   //计算差值
echo "<br />[页面执行时间:{$total} ]秒";
?>

相关文章

PHP插件PHPMailer发送邮件功能

PHP插件PHPMailer发送邮件功能

本文实例为大家分享了ThinkPHP3.2.3发送邮件的具体代码,供大家参考,具体内容如下 首先第一步 :在网上down了一个PHPMailer插件,下载解压后,这里我们只需要用到其中两...

PHP循环获取GET和POST值的代码

复制代码 代码如下:if(is_array($HTTP_GET_VARS))     {     &nbs...

PHP实现压缩图片尺寸并转为jpg格式的方法示例

本文实例讲述了PHP实现压缩图片尺寸并转为jpg格式的方法。分享给大家供大家参考,具体如下: <?php function ImageToJPG($srcFile,$d...

PHP 获取文件权限函数介绍

复制代码 代码如下:/* * substr 返回字符串的子串 * base_convert  在任意进制之间转换数字 * fileperms&nb...

php preg_replace替换实例讲解

php preg_replace替换实例讲解

复制代码 代码如下:mixed preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $l...