bonsaicode/timer
Composer 安装命令:
composer require bonsaicode/timer
包简介
Timer utility class for benchmarking your PHP code.
关键字:
README 文档
README
Timer utility class.
- Timer class for benchmarking your code.
Requirements
- PHP 7.1 or higher
Installation
To install the module, run the following command in the console:
$ composer require "bonsaicode/timer"
Usage
<?php
# instantiating Timer automatically starts the timer unless you pass false to the constructor
$timer = new BonsaiCode\Timer();
# [ put code here that you want to time ]
# get the elapsed time as a string, defaults to 8 decimal places
echo 'Elapsed seconds: '.$timer->get()."\n";
# restart the timer
$timer->start();
# [ put code here that you want to time ]
# pause the timer
$timer->pause();
# [ code you don't want to time ]
# resume the timer
$timer->unpause();
# show elapsed time since the last start, exclude all paused time
echo 'Elapsed seconds: '.$timer->get()."\n";
?>
Credits
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: mit
- 更新时间: 2019-08-04