PHP头条
热点:

php统计时间和内存的使用情况



php教程|PHP源码php 统计时间和内存的使用情况 php 统计时间和内存的使用情况 php教程-PHP源码跳至linux c库函数源码,ubuntu脚本换源,tomcat的作用是啥,网络爬虫黑客,php 模板和插件,湖南移动端seo关键词优化推广lzw

/** * 记录和统计时间(微秒)和内存使用情况 * 使用方法: * * G('begin'); // 记录开始标记位 * // ... 区间运行代码 * G('end'); // 记录结束标签位 * echo G('begin','end',6); // 统计区间运行时间 精确到小数后6位 * echo G('begin','end','m'); // 统计区间内存使用情况 * 如果end标记位没有定义,则会自动以当前作为标记位 * 其中统计内存使用需要 MEMORY_LIMIT_ON 常量为true才有效 * * @param string $start 开始标签 * @param string $end 结束标签 * @param integer|string $dec 小数位或者m * @return mixed */function G($start,$end='',$dec=4) { static $_info = array(); static $_mem = array(); if(is_float($end)) { // 记录时间 $_info[$start] = $end; }elseif(!empty($end)){ // 统计时间和内存使用 if(!isset($_info[$end])) $_info[$end] = microtime(TRUE); if(MEMORY_LIMIT_ON && $dec=='m'){ if(!isset($_mem[$end])) $_mem[$end] = memory_get_usage(); return number_format(($_mem[$end]-$_mem[$start])/1024); }else{ return number_format(($_info[$end]-$_info[$start]),$dec); } }else{ // 记录时间和内存使用 $_info[$start] = microtime(TRUE); if(MEMORY_LIMIT_ON) $_mem[$start] = memory_get_usage(); }}极简笔记源码分析,ubuntu下载后解压,Tomcat启动的项目名字,论文图片爬虫,宠物管理系统php代码,seo是什么搜行者SEOlzw下载源码大师,vscode怎么爬取电影,关闭ubuntu认证,tomcat怎么下载应用,java 爬虫 入门,php要求配置,资阳做推广的seo服务,网站首页导航源码,培训 dedecms模板免费下载lzw

www.phpzy.comtrue/phpzx/49735.htmlTechArticlephp统计时间和内存的使用情况 php教程|PHP源码 php 统计时间和内存的使用情况 php教程-PHP源码跳至linux c库函数源码,ubuntu脚本换源,tomcat的作用是啥,网络爬虫黑客,php 模板和插件,湖南移动端...

相关文章

PHP之友评论

今天推荐