public function stopMeasure(string $name, array $params = []): void
    {
        $end = \microtime(true);

        if (! $this->hasStartedMeasure($name)) {
            throw new RuntimeException(\sprintf(
                'Failed stopping measure [%s] because it hasn\'t been started.',
                $name
            ));
        }

        $this->addMeasure(
            $this->startedMeasures[$name]['label'],
            $this->startedMeasures[$name]['start'],
            $end,
            $params,
            $this->startedMeasures[$name]['collector']
        );

        unset($this->startedMeasures[$name]);
    }