当前位置:网站首页>thinkphp 常用技巧
thinkphp 常用技巧
2022-08-04 00:58:00 【Robin罗兵】
一、查看代码运行时间、内存开销
查看运行时间
Debug::remark('begin'); --开始标记
Debug::remark('end'); --结束标记
Debug::getRangeTime('begin','end',6) --第三个参数默认为4,如果觉得这个统计精度不够,还可以设置。
Log::record("/index/my_api".Debug::getRangMem('begin','end',6))
查看内存开销:
Debug::remark('begin'); --开始标记
Debug::remark('end'); --结束标记
Debug::getRangeMem('begin','end') -- 统计单位为kb
助手函数
debug('begin');
// ...其他代码段
debug('end');
// ...也许这里还有其他代码
// 进行统计区间
echo debug('begin','end').'s';
echo debug('begin','end',6).'s';
echo debug('begin','end','m').'kb';边栏推荐
- ThreadLocal
- outputBufferIndex = mDecode.dequeueOutputBuffer(bufferInfo, 0) 一直返回为-1
- 越来越火的图数据库到底能做什么?
- ASP.NET 获取数据库的数据并写入到excel表格中
- LYVE1抗体丨Relia Tech LYVE1抗体解决方案
- Vant3 - click on the corresponding name name to jump to the next page corresponding to the location of the name of the TAB bar
- 轻量级网络整理及其在Yolov5上的实现
- Google Earth Engine ——利用公开的河流数据计算河流的有效宽度
- c语言分层理解(c语言指针(上))
- C 学生管理系统 显示链表信息、删除链表
猜你喜欢
随机推荐
轻量级网络整理及其在Yolov5上的实现
After building the pytorch environment, the pip and conda commands cannot be used
共享新能源充电桩充电站建设需要些什么流程及资料?
typescript50-交叉类型和接口之间的类型说明
扩展卡尔曼滤波EKF
Apache DolphinScheduler新一代分布式工作流任务调度平台实战-中
Spinnaker调用Jenkins API 返回403错误
C# wpf使用ffmpeg命令行实现录屏
typescript53-泛型约束
Nanoprobes丨Nanogold-抗体和链霉亲和素偶联物
Nanoprobes Alexa Fluor 488 FluoroNanogold 偶联物
2022年8月份DAMA-CDGA/CDGP数据治理认证招生简章
pcl点云数据 转化为 Eigen::Map
虚拟机CentOS7中无图形界面安装Oracle
SQL优化的一些建议,希望可以帮到和我一样被SQL折磨的你
BioVendor人Clara细胞蛋白(CC16)Elisa试剂盒检测步骤
jmeter distributed stress test
Modulo operation (MOD)
哎,又跟HR在小群吵了一架!
米哈游--测试开发提前批









