rein/profiler

There is no license information available for the latest version (1.2) of this package.

Native PHP profiler

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/rein/profiler

1.2 2021-11-21 23:18 UTC

This package is auto-updated.

Last update: 2025-12-22 08:08:12 UTC


README

To use the profiler, you must define in environment variables PROFILE_MODE:

  • "OFF" (or empty) - don't run profiler.
  • "TIMING" - calculate the running time of the application.
  • "TRACE" - full functions tracing.

To examine any script, it must contain definition ticks = 1 or was included via Profiler::include. You can declare ticks = 1 at the beginning of the root script to test it too.

Test results can be obtained by calling the profiler and specifying the "onShutdown" method. Example:

rein\profiler\Profiler::getInstance() ->onShutdown = fn(array $timings) => var_dump($timings);