Benchmark
class Benchmark
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.
Flush all static state.
Details
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 103
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
at line 17
static array|float
measure(Closure|array $benchmarkables, int $iterations = 1)
Measure a callable or array of callables over the given number of iterations.
at line 44
static array
value(callable $callback)
Measure a callable once and return the result and duration in milliseconds.
at line 58
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.
at line 70
static void
flushState()
Flush all static state.