You are here

public function StopwatchEvent::__construct in Devel 8.3

Same name and namespace in other branches
  1. 8 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::__construct()
  2. 8.2 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::__construct()
  3. 4.x webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::__construct()

Constructor.

Parameters

float $origin: The origin time in milliseconds.

string|null $category: The event category or null to use the default.

Throws

\InvalidArgumentException When the raw time is not valid.

File

webprofiler/src/Stopwatch.php, line 366

Class

StopwatchEvent
Class StopwatchEvent.

Namespace

Drupal\webprofiler

Code

public function __construct($origin, $category = NULL) {
  $this->origin = $this
    ->formatTime($origin);
  $this->category = is_string($category) ? $category : 'default';
}