You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
6 years ago | |
---|---|---|
class | 6 years ago | |
LICENSE | 6 years ago | |
README.md | 6 years ago | |
timer-example.php | 6 years ago |
README.md
Timer_Class
Simple and small timer class to allow tracking of functions/API's and ajax calls.
- udate - Converts a micro timestamp into a date format
- start - Stores the start time
- end - Stores the end time
- time - Returns the (end - start) times NO FORMATING
- format_time - Returns the (end - start) times formated
- avg_time - Returns the (end - start) times NO FORMATING
- format_avg_time - Returns the (end - start) times formated
Quick Example
timer-example.php
<?php
// == TIMER CLASS ====================================
require_once 'classes/timer.php';
// -- Init Class
$timer = new timer();
//
// -- Run the Timer
$timer->start(); // <- Places a value for Start of Timer
sleep(5); // <- Pause
$timer->end(); // <- Places a value for End of Timer
// -- Output the Results
echo $timer->startTimer . '<br />';
echo $timer->endTimer . '<br />';
echo $timer->time() . '<br />';
echo $timer->format_time() . '<br />';
echo $timer->avg_time(5) . '<br />';
echo $timer->format_avg_time(5);
// ===================================================
$timer = null;