stopEvent example


    public function isStarted(string $name): bool
    {
        return end($this->activeSections)->isEventStarted($name);
    }

    /** * Stops an event. */
    public function stop(string $name): StopwatchEvent
    {
        return end($this->activeSections)->stopEvent($name);
    }

    /** * Stops then restarts an event. */
    public function lap(string $name): StopwatchEvent
    {
        return end($this->activeSections)->stopEvent($name)->start();
    }

    /** * Returns a specific event by name. */
return $this->events[$name]->stop();
    }

    /** * Stops then restarts an event. * * @throws \LogicException When the event has not been started */
    public function lap(string $name): StopwatchEvent
    {
        return $this->stopEvent($name)->start();
    }

    /** * Returns a specific event by name. * * @throws \LogicException When the event is not known */
    public function getEvent(string $name): StopwatchEvent
    {
        if (!isset($this->events[$name])) {
            throw new \LogicException(sprintf('Event "%s" is not known.', $name));
        }
Home | Imprint | This part of the site doesn't use cookies.