class SystemStopWatchWithOffset
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
@internal This class is not covered by the backward compatibility promise for PHPUnit
@codeCoverageIgnore
Hierarchy
- class \PHPUnit\Event\Telemetry\SystemStopWatchWithOffset implements \PHPUnit\Event\Telemetry\StopWatch
Expanded class hierarchy of SystemStopWatchWithOffset
File
-
vendor/
phpunit/ phpunit/ src/ Event/ Value/ Telemetry/ SystemStopWatchWithOffset.php, line 22
Namespace
PHPUnit\Event\TelemetryView source
final class SystemStopWatchWithOffset implements StopWatch {
private ?HRTime $offset;
public function __construct(HRTime $offset) {
$this->offset = $offset;
}
/**
* @throws InvalidArgumentException
*/
public function current() : HRTime {
if ($this->offset !== null) {
$offset = $this->offset;
$this->offset = null;
return $offset;
}
return HRTime::fromSecondsAndNanoseconds(...hrtime());
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
SystemStopWatchWithOffset::$offset | private | property | ||
SystemStopWatchWithOffset::current | public | function | Overrides StopWatch::current | |
SystemStopWatchWithOffset::__construct | public | function |