kanel/benchmark
Composer 安装命令:
composer require kanel/benchmark
包简介
Benchmark your code by tracking duration and memory usage of your code
README 文档
README
A simple tool to benchmark time execution and memory usage
#How it works :
-
Start the benchmarkg
Benchmark::start(); -
Mark a place as a lap (the benchmark will continue)
$usage = Benchmark::lap();where $usage is an array :
[ 'time' => ..., 'memory' => ..., ] -
If you want the benchmark between the two last laps, send the following parameter:
$usage = Benchmark::lap(Benchmark::FROM_LAST_LAP); -
To stop the Benchmark and get the time/memory from the beginning (the start)
$usage = Benchmark::stop(); -
To stop the Benchmark tracking and get the memory used and duration from the last lap
$usage = Benchmark::stop(Benchmark::FROM_LAST_LAP); -
To get the Benchmark history
$usage = Benchmark::getHistory();
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2017-04-05