Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 20, 2024 via composer

symfony/stopwatch v2.8.40

Symfony Stopwatch Component
Package summary
Share
0
issues
1
license
1
MIT
Package created
10 Nov 2012
Version published
3 Jan 2018
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
symfony/stopwatch@v2.8.40
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of symfony/stopwatch 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does symfony/stopwatch do?

The symfony/stopwatch is a PHP-based Composer package that provides an efficient way to profile code. If you are looking for a tool to time parts of your code and calculate the duration of PHP processes, symfony/stopwatch is an excellent tool worth considering. It allows not just the configuration and starting the stopwatch, but also opening sections for specific, grouped events and stopping sections or individual events, and determining 'lap' times.

How do you use symfony/stopwatch?

To start using symfony/stopwatch, you will first need to add it to your project through Composer. Run the following command to install:

$ composer require symfony/stopwatch

After installation, you can use it in your PHP code as follows:

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');

In this example, an instance of Stopwatch is created and a section is opened. An event is started named 'eventName', then a lap is set with 'foo'. After running some more code, the event 'eventName' is stopped along with the section 'phase_1'.

Keep in mind that specific processes or blocks of code to be timed need to be placed where the comment // ... run your code here is.

Where are the symfony/stopwatch docs?

While the symfony/stopwatch readme provides initial usage information, in the package's main repository, https://github.com/symfony/stopwatch.git, you can find links for further information and resources. For in-depth documentation about Symfony's Stopwatch component, visit Symfony's official website. If you wish to contribute to the package or report issues, follow the links provided in the readme to the main Symfony repository and associated GitHub pages.