Recommend this page to a friend! |
Download .zip |
Info | View files (12) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2023-10-06 (15 days ago) | Not yet rated by the users | Total: 28 This week: 1 | All time: 10,933 This week: 119 |
Version | License | PHP version | Categories | |||
profiler-php 1.0 | MIT/X Consortium ... | 7 | Time and Date, Performance and optimi..., P... |
Description | Author | |
This package can measure the elapsed time between PHP code sections. |
Profiler helper
composer require smoren/profiler
composer install
composer test-init
composer test
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
)
*/
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (1 directory) | ||||
src (2 files) | ||||
tests (3 files, 2 directories) | ||||
codeception.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Files | / | src |
File | Role | Description |
---|---|---|
Profiler.php | Class | Class source |
ProfilerException.php | Class | Class source |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
unit (1 file) | ||||
_support (1 file) | ||||
coding_standard.xml | Data | Auxiliary data | ||
unit.suite.yml | Data | Auxiliary data | ||
_bootstrap.php | Aux. | Auxiliary script |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.