没有合适的资源?快使用搜索试试~ 我知道了~
elapsed_time 函数计算时间差 $this->banchmark ->mark("code_start") $this -> benchmark -> mark('code_end'); echo $this -> benchamark -> elapsed_time('code_start','code_end')
资源推荐
资源详情
资源评论
elapsed_time 函数计算时间差
$this->banchmark ->mark("code_start")
$this -> benchmark -> mark('code_end');
echo $this -> benchamark -> elapsed_time('code_start','code_end')
2、从CodeIgniter运行开始到最终结果输出到浏览器之间花费的总时间,只需在视图文件中:
<?php echo $this ->benchmark->elapsed_time();?>
或以伪变量的方式来显示总执行时间:{elapsed_time}
显示内存
3、如果你的PHP在安装时使用了--enable-memory-limit参数进行编译,你就可以在你的视图文件中,使用下面代码来显示整个系统占用的内存大小;
<?php echo $this -> benchmark ->memory_usage;?>
也可{memory_usage}
类参考
CI_Benchmark
$this->load->driver(cache');
if(!$foo = $this ->cache-get("foo"));
{
echo ="saving to the cache!<br>";
$foo = 'foobarbaz!';
//save into the cache for 5 mintes
$this->cache->save("foo",$foo,300);
}
echo $foo;
//key_prefix参数给缓存 名添加前缀,录在同一个环境下去行多个应用时,它可避免冲突
$this->banchmark ->mark("code_start")
$this -> benchmark -> mark('code_end');
echo $this -> benchamark -> elapsed_time('code_start','code_end')
2、从CodeIgniter运行开始到最终结果输出到浏览器之间花费的总时间,只需在视图文件中:
<?php echo $this ->benchmark->elapsed_time();?>
或以伪变量的方式来显示总执行时间:{elapsed_time}
显示内存
3、如果你的PHP在安装时使用了--enable-memory-limit参数进行编译,你就可以在你的视图文件中,使用下面代码来显示整个系统占用的内存大小;
<?php echo $this -> benchmark ->memory_usage;?>
也可{memory_usage}
类参考
CI_Benchmark
$this->load->driver(cache');
if(!$foo = $this ->cache-get("foo"));
{
echo ="saving to the cache!<br>";
$foo = 'foobarbaz!';
//save into the cache for 5 mintes
$this->cache->save("foo",$foo,300);
}
echo $foo;
//key_prefix参数给缓存 名添加前缀,录在同一个环境下去行多个应用时,它可避免冲突
资源评论
zhaojingning
- 粉丝: 35
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功