joruro/stopwatch
Composer 安装命令:
composer require joruro/stopwatch
包简介
Very simple stopwatch capable of register multi execution times.
关键字:
README 文档
README
Stopwatch is a very simple tool for measuring the execution time of multiple parts of your code.
Example of usage
<?php include('../vendor/autoload.php'); use Joruro\Enum\TimeUnits; use Joruro\Stopwatch\Stopwatch; $attempts = 2; $counter = 5; Stopwatch::start(); for ($j = 0; $j < $attempts; $j++) { Stopwatch::start(); for ($i = 0; $i < $counter; $i++) { sleep(1); } $time = Stopwatch::stop(TimeUnits::SECONDS); echo "A foreach of {$counter} loops took approximately {$time} seconds\n"; } $time = Stopwatch::stop(TimeUnits::SECONDS); echo "{$attempts} attempts foreach of {$counter} loops took approximately {$time} seconds\n"; exit(0);
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-07