function Duration::asString
Same name in this branch
- 11.1.x vendor/phpunit/phpunit/src/Event/Value/Telemetry/Duration.php \PHPUnit\Event\Telemetry\Duration::asString()
File
-
vendor/
phpunit/ php-timer/ src/ Duration.php, line 73
Class
- Duration
- @psalm-immutable
Namespace
SebastianBergmann\TimerCode
public function asString() : string {
$result = '';
if ($this->hours > 0) {
$result = sprintf('%02d', $this->hours) . ':';
}
$result .= sprintf('%02d', $this->minutes) . ':';
$result .= sprintf('%02d', $this->seconds);
if ($this->milliseconds > 0) {
$result .= '.' . sprintf('%03d', $this->milliseconds);
}
return $result;
}