function 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 322

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