private function StopwatchEvent::formatTime

Formats a time.

Parameters

numerical $time A raw time:

Return value

float The formatted time

Throws

\InvalidArgumentException When the raw time is not valid

3 calls to StopwatchEvent::formatTime()
StopwatchEvent::getNow in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php
Return the current time relative to origin.
StopwatchEvent::getTotalTime in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php
Gets the total time of all periods.
StopwatchEvent::__construct in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php
Constructor.

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php, line 174

Class

StopwatchEvent
Represents an Event managed by Stopwatch.

Namespace

Symfony\Component\HttpKernel\Debug

Code

private function formatTime($time) {
  if (!is_numeric($time)) {
    throw new \InvalidArgumentException('The time must be a numerical value');
  }
  return round($time, 1);
}