<?php
function ss_timing_start($name='default')
{
global $ss_timing_start_times;
$ss_timing_start_times[$name] = explode(' ',microtime());
}
function ss_timing_stop ($name = 'default') {
global $ss_timing_stop_times;
$ss_timing_stop_times[$name] = explode(' ', microtime());
}
function ss_timing_current ($name = 'default') {
global $ss_timing_start_times, $ss_timing_stop_times;
if (!isset($ss_timing_start_times[$name])) {
return 0;
}
if (!isset($ss_timing_stop_times[$name])) {
$stop_time = explode(' ', microtime());
}
else {
$stop_time = $ss_timing_stop_times[$name];
}
$current = $stop_time[1] - $ss_timing_start_times[$name][1];
$current += $stop_time[0] - $ss_timing_start_times[$name][0];
return $current;
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
php运行时间计算函数
共1个文件
php:1个
3星 · 超过75%的资源 需积分: 9 14 下载量 130 浏览量
2011-02-23
08:24:59
上传
评论
收藏 390B ZIP 举报
温馨提示
速度测试函数 为了优化代码,我们需要一种可以测试代码运行时间的方法,从而来选择最优的代码。 现在可以轻松地检查任何一段代码的执行时间了,甚至我们可以同时使用多个计时器,只需在使用上述的几个函数时设定不同的参数作为计时器的名称就可以了。
资源推荐
资源详情
资源评论
收起资源包目录
times.zip (1个子文件)
times.php 782B
共 1 条
- 1
资源评论
- mystruts_12012-06-29这个php时间计算函数,简单易用,可以作为时间统计还好。
Seph
- 粉丝: 15
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功