Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Duration.php

function Duration::asString

Same name in this branch
  1. 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\Timer

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal