diff options
| author | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-09 02:49:56 +0000 |
|---|---|---|
| committer | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-09 03:08:30 +0000 |
| commit | e41d6361221a30ca9d996cde7591111e626b7e1c (patch) | |
| tree | 4572f61f37bbc76192ad60e0940c281483bc03af /vendor/phpunit/php-timer/src/Timer.php | |
| parent | ab0aabf8548c206f3f624de5451a9b6abbde90be (diff) | |
Remove dev dependencies and update the rest.
Diffstat (limited to 'vendor/phpunit/php-timer/src/Timer.php')
| -rw-r--r-- | vendor/phpunit/php-timer/src/Timer.php | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/vendor/phpunit/php-timer/src/Timer.php b/vendor/phpunit/php-timer/src/Timer.php deleted file mode 100644 index 0917109be..000000000 --- a/vendor/phpunit/php-timer/src/Timer.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php declare(strict_types=1); -/* - * This file is part of phpunit/php-timer. - * - * (c) Sebastian Bergmann <sebastian@phpunit.de> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Timer; - -use function array_pop; -use function hrtime; - -final class Timer -{ - /** - * @psalm-var list<float> - */ - private $startTimes = []; - - public function start(): void - { - $this->startTimes[] = (float) hrtime(true); - } - - /** - * @throws NoActiveTimerException - */ - public function stop(): Duration - { - if (empty($this->startTimes)) { - throw new NoActiveTimerException( - 'Timer::start() has to be called before Timer::stop()' - ); - } - - return Duration::fromNanoseconds((float) hrtime(true) - array_pop($this->startTimes)); - } -} |