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

1.0.1 2021-04-12 06:21 UTC

This package is not auto-updated.

Last update: 2024-11-11 18:31:19 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"]