| Recommend this page to a friend! | 
|  Download | 
| Info |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not yet rated by the users | Total: 36 | All time:  11,013 This week: 74  | ||||
| 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 (12) | 
| 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 (12) | / | src | 
| File | Role | Description | 
|---|---|---|
|  Profiler.php | Class | Class source | 
|  ProfilerException.php | Class | Class source | 
|  Files (12) | / | 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 | ||
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
|  Install with Composer | 
| 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.
 If you know an application of this package, send a message to the author to add a link here.