edbizarro / timer

Measure execution time of your code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timer - measure execution time of your code


Here are a few examples on how you can use the package:

use Edbizarro\Timer\Timer;

$timer = Timer::start('timer01');
sleep(2);
$result = $timer->stop();

print_r($result);

// array:7 [                                                                                                                                                                                                
//   "start" => 1529506852.084                                                                                                                                                                              
//   "end" => 1529506854.0855                                                                                                                                                                               
//   "duration" => 2.0015239715576                                                                                                                                                                          
//   "milliseconds" => 2001.5239715576                                                                                                                                                                      
//   "seconds" => 2                                                                                                                                                                                         
//   "minutes" => 0                                                                                                                                                                                         
//   "hours" => 0                                                                                                                                                                                           
// ]    

Installation

You can install the package via composer:

composer require edbizarro/timer

forthebadge

About

Measure execution time of your code

License:MIT License


Languages

Language:PHP 100.0%