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-09-26 12:07:58
最后一次提交
發布數31
最新版本名稱8.0.0 (發布於 2025-02-07 05:59:42)
第一版名稱1.0.0 (發布於 2010-05-08 16:43:30)
用户参与
星數7.7k
關注者數19
派生數64
提交數463
已啟用問題?
問題數20
打開的問題數0
拉請求數14
打開的拉請求數0
關閉的拉請求數8
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?