主页
class Index
{
    public function __construct(){
        Debug::remark('begin');
    }
     //比如在其他接口想要返回执行的结果,只需要调用$this->getRunData()即可。
     private function getRunData(){
             Debug::remark('end');
             // //生成接口请求日志记录
             // $interface = [
             //     'interface_name' => request()->action(),
             //     'request_str'    => json_encode($array),
             //     'response_str'   => json_encode($res),
             //     'response_code'  => $res['result'],
             //     'response_time'  => 
             // ];
             return [
                 'time'=>Debug::getRangeTime('begin','end').'s',
                 'memery'=>round(memory_get_usage()/1024/1024,2)."MB"
             ];

     }
}

php debug 性能调试

版权属于:WANYL
作品采用:本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
0

目录

来自 《tp5 性能调试,获取执行内存大小和执行时长》
评论

WANYL

博主很懒,啥都没有
123 文章数
0 评论量
11 分类数
124 页面数
已在风雨中度过 3年289天18小时46分