weiyongsheng / laravel-performance by weiyongsheng

laravel performance and sql dump.
83
2
2
Package Data
Maintainer Username: weiyongsheng
Maintainer Contact: shenglian3344@163.com (weiyongsheng)
Package Create Date: 2016-05-20
Package Last Update: 2017-04-15
Language: PHP
License: MIT
Last Refreshed: 2024-12-15 03:00:29
Package Statistics
Total Downloads: 83
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Laravel Performance

  • 计算代码块的执行时长
  • 打印代码块的sql

Usage

  • 计算代码块的执行时长
pf()->auto('search1');
#代码块
pf()->auto('search1');
var_dump(pf()->getBenchmarkTime());

##### or #####

pf()->start('search2');
#代码块
pf()->end('search2');
var_dump(pf()->getBenchmarkTime());
  • 打印代码块的sql
pf()->startRecordQueries();
#sql查询代码
$sql = pf()->getSql();
var_dump($sql);