erlangparasu/laravel-sf-stopwatch

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

A package to log execution time

Installs: 168

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/erlangparasu/laravel-sf-stopwatch

1.0.1 2021-04-12 06:21 UTC

This package is not auto-updated.

Last update: 2025-09-29 22:44:09 UTC


README

A simple package that help you to report execution time to laravel log file.

Installation

composer require erlangp/laravel-sf-stopwatch

How to use

sf_stopwatch()->x();

echo 'Processing';

sf_stopwatch()->x();

sleep(5); // example simulate long running task

sf_stopwatch()->x();

echo 'Done';

sf_stopwatch()->x();

example output in laravel.log

[2021-10-18 11:30:18] local.DEBUG: stopwatch: ["default/watch_9KAH2MJ6_1: 22.00 MiB - 37 ms"] 
[2021-10-18 11:30:23] local.DEBUG: stopwatch: ["default/watch_9KAH2MJ6_2: 22.00 MiB - 5031 ms"] 
[2021-10-18 11:30:24] local.DEBUG: stopwatch: ["default/watch_9KAH2MJ6_3: 22.00 MiB - 25 ms"]