class Benchmark (View source)

Methods

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 duration and result.

static void
dd(Closure|array $benchmarkables, int $iterations = 1)

Measure a callable or array of callables over the given number of iterations, then dump and die.

Details

static array|float measure(Closure|array $benchmarkables, int $iterations = 1)

Measure a callable or array of callables over the given number of iterations.

Parameters

Closure|array $benchmarkables
int $iterations

Return Value

array|float

static array value(callable $callback)

Measure a callable once and return the duration and result.

Parameters

callable $callback

Return Value

array

static void dd(Closure|array $benchmarkables, int $iterations = 1)

Measure a callable or array of callables over the given number of iterations, then dump and die.

Parameters

Closure|array $benchmarkables
int $iterations

Return Value

void

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.