当前位置:网站首页>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';边栏推荐
- 虚拟机CentOS7中无图形界面安装Oracle
- After building the pytorch environment, the pip and conda commands cannot be used
- 哎,又跟HR在小群吵了一架!
- 2022年8月份DAMA-CDGA/CDGP数据治理认证招生简章
- Nanoprobes Mono- Sulfo -NHS-Nanogold的使用和应用
- 2022-08-03: What does the following go code output?A: 2; B: 3; C: 1; D: 0.package main import "fmt" func main() { slice := []i
- 分析:Nomad Bridge黑客攻击的独特之处
- typescript54-泛型约束
- js函数防抖和函数节流及其使用场景
- 【性能优化】MySQL性能优化之存储引擎调优
猜你喜欢
随机推荐
高斯推断推导
Observability:你所需要知道的关于 Syslog 的一些知识
Web3 安全风险令人生畏?应该如何应对?
字符串变形
View the version number of CUDA, pytorch, etc.
越来越火的图数据库到底能做什么?
一文参透分布式存储系统Ceph的架构设计、集群搭建(手把手)
互斥锁、读写锁、自旋锁,以及原子操作指令xaddl、cmpxchg的使用场景剖析
MySQL回表指的是什么
Sqlnet. Ora file with the connection of authentication test
Nanoprobes丨Nanogold-抗体和链霉亲和素偶联物
即席查询——Presto
BioVendor人Clara细胞蛋白(CC16)Elisa试剂盒检测步骤
【超详细教程】LVS+KeepAlived高可用部署实战应用
迭代扩展卡尔曼滤波IEKF
面试必问的HashCode技术内幕
It will invest about 200 billion US dollars in the United States in 20 years, and Samsung Electronics looks so handsome
LeetCode third topic (the Longest Substring Without Repeating Characters) trilogy # 3: two optimization
特征值与特征向量
typescript48-函数之间的类型兼容性








