# sebastianbergmann/php-timer

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/sebastianbergmann-php-timer).**

7,744 stars · 63 forks · PHP · BSD-3-Clause

## Links

- GitHub: https://github.com/sebastianbergmann/php-timer
- awesome-repositories: https://awesome-repositories.com/repository/sebastianbergmann-php-timer.md

## Description

php-timer is a set of utilities for measuring, tracking, and formatting the execution duration and memory consumption of PHP code segments. It functions as an execution timer and performance profiling utility to analyze resource consumption.

The project provides capabilities to track the duration between start and stop triggers in seconds, milliseconds, or nanoseconds. It also includes a resource usage tracker that converts raw execution timestamps and memory bytes into human-readable text strings for reporting.

The tool covers performance profiling, resource monitoring, and request duration tracking. These capabilities allow for the calculation of elapsed time and memory usage from the start of a process to a specific execution point.

## Tags

### Software Engineering & Architecture

- [Function Execution Timing](https://awesome-repositories.com/f/software-engineering-architecture/function-execution-timing.md) — Measures the precise elapsed time of PHP code segments to identify performance bottlenecks.
- [Execution State Timers](https://awesome-repositories.com/f/software-engineering-architecture/execution-state-timers.md) — Maintains internal timestamps to calculate precise elapsed time between defined start and stop points.
- [Execution Time Measurements](https://awesome-repositories.com/f/software-engineering-architecture/execution-time-measurements.md) — Tracks the duration between start and stop triggers in seconds, milliseconds, or nanoseconds. ([source](https://github.com/sebastianbergmann/php-timer/blob/main/phpstan.neon))
- [Monotonic Time Measurement](https://awesome-repositories.com/f/software-engineering-architecture/monotonic-time-measurement.md) — Implements high-resolution timing using monotonic clocks to ensure precise execution duration measurements.
- [Resource Usage Aggregators](https://awesome-repositories.com/f/software-engineering-architecture/resource-usage-aggregators.md) — Combines memory peaks and execution durations into a single object for streamlined performance reporting.

### Development Tools & Productivity

- [PHP Application Profilers](https://awesome-repositories.com/f/development-tools-productivity/php-application-profilers.md) — Provides a toolkit for measuring execution time and memory usage specifically for PHP runtimes.
- [PHP Execution Timers](https://awesome-repositories.com/f/development-tools-productivity/php-execution-timers.md) — Ships a specialized tool for measuring and formatting the elapsed time and memory of PHP code segments.
- [Resource Metric Formatters](https://awesome-repositories.com/f/development-tools-productivity/resource-metric-formatters.md) — Provides mathematical scaling to convert nanoseconds and bytes into human-readable reporting strings.
- [Resource Usage Formatters](https://awesome-repositories.com/f/development-tools-productivity/resource-usage-formatters.md) — Converts raw execution timestamps and memory bytes into human-readable strings for reporting.

### System Administration & Monitoring

- [PHP Runtime Monitors](https://awesome-repositories.com/f/system-administration-monitoring/server-resource-monitors/php-runtime-monitors.md) — Tracks memory consumption and execution duration during a request to optimize resource usage.
- [Execution Duration Tracking](https://awesome-repositories.com/f/system-administration-monitoring/execution-duration-tracking.md) — Calculates total elapsed time and memory used from the start of a process to the current point. ([source](https://github.com/sebastianbergmann/php-timer/blob/main/README.md))
- [Performance Reporting](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/metric-performance-monitors/performance-visualization/performance-reporting.md) — Generates human-readable summaries of PHP execution and memory metrics for developer reports.

### Data & Databases

- [Usage Report Renderers](https://awesome-repositories.com/f/data-databases/data-serialization-formats/data-formats/output-format-rendering/usage-report-renderers.md) — Renders resource consumption data into human-readable strings for performance reporting. ([source](https://github.com/sebastianbergmann/php-timer/blob/main/README.md))
