当前位置:网站首页>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';
边栏推荐
- Modulo operation (MOD)
- vxe-table 从页面批量删除数据 (不动数据库里的数据)
- .NET Static Code Weaving - Rougamo Release 1.1.0
- nodeJs--async/await
- 互斥锁、读写锁、自旋锁,以及原子操作指令xaddl、cmpxchg的使用场景剖析
- Google Earth Engine - Calculates the effective width of rivers using publicly available river data
- typescript55 - generic constraints
- 【性能优化】MySQL常用慢查询分析工具
- GraphQL背后处理及执行过程是什么
- 【超详细】手把手教你搭建MongoDB集群搭建
猜你喜欢
随机推荐
动态内存二
pcl点云数据 转化为 Eigen::Map
【详细教程】一文参透MongoDB聚合查询
jmeter分布式压测
优秀的测试/开发程序员,是怎样修炼的?步步为营地去执行......
MySQL回表指的是什么
ThreadLocal
C # WPF equipment monitoring software (classic) - the next
Google Earth Engine - Calculates the effective width of rivers using publicly available river data
Node.js的基本使用(三)数据库与身份认证
全面讲解 Handler机制原理解析 (小白必看)
迭代扩展卡尔曼滤波IEKF
如何通过单步调试的方式找到引起 Fiori Launchpad 路由错误的原因试读版
typescript53 - generic constraints
c语言分层理解(c语言指针(上))
typescript54 - generic constraints
WMS仓储管理系统能解决电子行业哪些仓库管理问题
特征值与特征向量
手撕Nacos源码,今日撕服务端源码
BioVendor人Clara细胞蛋白(CC16)Elisa试剂盒检测步骤