php-timer

Utility class for timing

  • 所有者: sebastianbergmann/php-timer
  • 平台:
  • 许可证: BSD 3-Clause "New" or "Revised" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

phpunit/php-timer

CI Status
Type Coverage

Utility class for timing things, factored out of PHPUnit into a stand-alone component.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require phpunit/php-timer

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

composer require --dev phpunit/php-timer

Usage

Basic Timing

use SebastianBergmann\Timer\Timer;

Timer::start();

// ...

$time = Timer::stop();
var_dump($time);

print Timer::secondsToTimeString($time);

The code above yields the output below:

double(1.0967254638672E-5)
0 ms

Resource Consumption Since PHP Startup

use SebastianBergmann\Timer\Timer;

print Timer::resourceUsage();

The code above yields the output below:

Time: 0 ms, Memory: 0.50MB

主要指标

概览
名称与所有者sebastianbergmann/php-timer
主编程语言PHP
编程语言PHP (语言数: 1)
平台
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2010-05-08 10:40:25
推送于2025-05-25 06:47:35
最后一次提交
发布数31
最新版本名称8.0.0 (发布于 2025-02-07 05:59:42)
第一版名称1.0.0 (发布于 2010-05-08 16:43:30)
用户参与
星数7.7k
关注者数20
派生数65
提交数459
已启用问题?
问题数20
打开的问题数0
拉请求数14
打开的拉请求数0
关闭的拉请求数8
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?