hcg/run-timer

php程序运行时间调试工具

v1.0.0 2021-12-27 05:59 UTC

This package is auto-updated.

Last update: 2025-05-27 15:04:05 UTC


README

php 程序运行时间调试工具

安装

composer require hcg/run-timer

使用示例

require_once './vendor/autoload.php';

use Hcg\RunTimer\RunTimer as RunTimer;

// 实例化
$timer = new RunTimer();
$timer->start();

# 需要执行的代码,我们这里简单的睡眠2秒,代表程序执行花费了2秒
sleep(2);

$timer->stop();
$timer->echo();

示例程序输出:程序运行时间为:2,000.1540毫秒