https://github.com/smoren/profiler-php
Profiler helper
https://github.com/smoren/profiler-php
debug php profiler
Last synced: 6 months ago
JSON representation
Profiler helper
- Host: GitHub
- URL: https://github.com/smoren/profiler-php
- Owner: Smoren
- License: mit
- Created: 2022-07-22T13:15:36.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-20T12:46:20.000Z (almost 3 years ago)
- Last Synced: 2025-03-28T13:21:13.544Z (6 months ago)
- Topics: debug, php, profiler
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# profiler

[](https://scrutinizer-ci.com/g/Smoren/profiler-php/?branch=master)
[](https://coveralls.io/github/Smoren/profiler-php?branch=master)

[](https://opensource.org/licenses/MIT)Profiler helper
### How to install to your project
```
composer require smoren/profiler
```### Unit testing
```
composer install
composer test-init
composer test
```### Usage
```php
use Smoren\Profiler\Profiler;function someTask()
{
Profiler::start('first');
usleep(10000);
Profiler::stop('first');Profiler::start('second');
usleep(20000);
Profiler::stop('second');
}for($i=0; $i<10; ++$i) {
someTask();
}Profiler::profile('third', function() {
usleep(30000);
});print_r(Profiler::getStatTime());
/*
Array
(
[second] => 0.2015209197998
[third] => 0.20024418830872
[first] => 0.10135746002197
)
*/print_r(Profiler::getStatCalls());
/*
Array
(
[first] => 10
[second] => 10
[third] => 1
)
*/
```