private function benchmark(string $event, $context = null): Benchmark
    {
        $container = ContainerScope::getContainer();
        if (empty($container) || !$container->has(BenchmarkerInterface::class)) {
            return new Benchmark(
                get_class($this),
                $event,
                $context
            );
        }

        return $container->get(BenchmarkerInterface::class)->record(
            get_class($this),
            $event,
            $context
        );
    }