src/Traits/BenchmarkTrait.php
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
        );
    }
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
        );
    }
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 ) ; }
Creates new benchmark record associated with current object.

@param string $event   Event name or set of names.
@param string $context Record context (if any).

@return Benchmark

@throws \Psr\Container\ContainerExceptionInterface
Creates new benchmark record associated with current object .