当前位置:网站首页>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';边栏推荐
- Analysis of usage scenarios of mutex, read-write lock, spin lock, and atomic operation instructions xaddl and cmpxchg
- typescript53-泛型约束
- LeetCode third topic (the Longest Substring Without Repeating Characters) trilogy # 3: two optimization
- Sqlnet. Ora file with the connection of authentication test
- Node.js的基本使用(三)数据库与身份认证
- typescript58-泛型类
- 【虚拟户生态平台】虚拟化平台安装时遇到的坑
- typescript51-泛型的基本使用
- Modulo operation (MOD)
- 求解同余方程 数论 扩展欧几里得
猜你喜欢

The 600MHz band is here, will it be the new golden band?

"Miscellaneous" barcode by Excel as a string

一文参透分布式存储系统Ceph的架构设计、集群搭建(手把手)

R3LIVE论文学习(二):VIO子系统

Vant3—— 点击对应的name名称跳转到下一页对应的tab栏的name的位置

typescript52-简化泛型函数调用

typescript50-交叉类型和接口之间的类型说明

因为一次bug的教训,我决定手撕Nacos源码(先撕客户端源码)

Apple told Qualcomm: I bought a new campus for $445 million and may plan to speed up self-development of baseband chips

越来越火的图数据库到底能做什么?
随机推荐
字符串变形
C 学生管理系统_添加学生
越来越火的图数据库到底能做什么?
数据库扩容也可以如此丝滑,MySQL千亿级数据生产环境扩容实战
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
建木DevOps流程的快速运用
XSS-绕过for循环过滤
jmeter distributed stress test
typescript55-泛型约束
《Greenplum构建实时数据仓库实践》简介
虚拟机CentOS7中无图形界面安装Oracle
114. How to find the cause of Fiori Launchpad routing error by single-step debugging
【虚拟户生态平台】虚拟化平台安装时遇到的坑
c语言分层理解(c语言操作符)
Vant3—— 点击对应的name名称跳转到下一页对应的tab栏的name的位置
新一代服务网关Gateway的实践笔记
Demand analysis of MES management system in electronic assembly industry
分子个数 数论(欧拉函数 前缀和
【链路聚合原理及配置】
Salesforce's China business may see new changes, rumors may be closing