symfony/stopwatch

提供代码分析的方法

v7.1.1 2024-05-31 14:57 UTC

This package is auto-updated.

Last update: 2024-09-06 08:43:46 UTC


README

Stopwatch 组件提供了一种分析代码的方式。

入门

composer require symfony/stopwatch
use Symfony\Component\Stopwatch\Stopwatch;

$stopwatch = new Stopwatch();

// optionally group events into sections (e.g. phases of the execution)
$stopwatch->openSection();

// starts event named 'eventName'
$stopwatch->start('eventName');

// ... run your code here

// optionally, start a new "lap" time
$stopwatch->lap('foo');

// ... run your code here

$event = $stopwatch->stop('eventName');

$stopwatch->stopSection('phase_1');

资源