Benchmark
class Benchmark (View source)
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Measure a callable once and return the result and duration in milliseconds.
Details
static void
macro(string $name, object|callable $macro)
Register a custom macro.
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
static bool
hasMacro(string $name)
Checks if macro is registered.
static void
flushMacros()
Flush the existing macros.
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
static array|float
measure(Closure|array $benchmarkables, int $iterations = 1)
Measure a callable or array of callables over the given number of iterations.
static array
value(callable $callback)
Measure a callable once and return the result and duration in milliseconds.
static never
dd(Closure|array $benchmarkables, int $iterations = 1)
Measure a callable or array of callables over the given number of iterations, then dump and die.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.