camspiers/bench
Composer 安装命令:
composer require camspiers/bench
包简介
README 文档
README
Basic benchmarking
Usage
Using bench\mark
bench\mark('somekey'); $result = calculateSomething(); echo bench\format(bench\collector()), PHP_EOL;
Using bench\invoke
$result = bench\invoke('calculateSomething'); echo bench\format(bench\collector()), PHP_EOL;
Using bench\wrap
$fn = bench\wrap('calculateSomething'); $result = $fn(); echo bench\format(bench\collector()), PHP_EOL;
Using bench\collector
bench\collector will collect up results of bench\invoke and bench\wrap.
When bench\collector is invoked without arguments it will return all results collected.
When there is only one result it will return that else it will return an array.
bench\invoke('calculateSomething'); bench\invoke('calculateSomething'); foreach (bench\formatTimes(bench\collector()) as $time) { echo $time, PHP_EOL; }
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-02-20