PHP Classes

Script timer: Measure the time a script takes to execute

Recommend this page to a friend!
  Info   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 64%Total: 829 All time: 4,172 This week: 555Up
Version License PHP version Categories
script_timer 1.0GNU Lesser Genera...3Performance and optimization
Description 

Author

This class can be used to measure the time a script takes to execute.

It can take note of the time it takes reach each part of a script takes to run and displays the results in a HTML table, so it can be used to analyse which parts of the script may need optimization.

It features:

* Add time markers recorded before class instantiation
* Temporarily pause the timer
* Group markers by script
* Optionally add subtotals per script (group)
* Uses PHP bcmath functions if possible for better accuracy
* Adjustable precision for the calculations
* Adjustable precision for the output
* Provides the following measurements:
- run time for the marker (excluding processing by this class)
- run time for the marker as a percentage of the total run time
- cumulative run time up to the marker
- cumulative percentage
* Customizable presentation of the results returning:
- a bi-dimensional array for custom external result processing
- an HTML string for use with a template system
- HTML for presentation to the user without further processing
* The details of presentation of the results can be customized with CSS

Picture of Juliette Reinders Folmer
Name: Juliette Reinders Folmer <contact>
Classes: 2 packages by
Country: The Netherlands The Netherlands
Age: 51
All time rank: 54714 in The Netherlands The Netherlands
Week rank: 215 Up4 in The Netherlands The Netherlands Up

Screenshots (1)  
  • sample_output.gif
  Files folder image Files (7)  
File Role Description
Files folder imageclasses (1 file)
Files folder imagetemplates (1 file)
Files folder imageDocumentation (1 file)
Files folder imageexamples (1 file)
Plain text file script_timer.inc.php Class Class file
Plain text file script_timer_nodoc.inc.php Class Class file without the docblock documentation

  Files folder image Files (7)  /  classes  
File Role Description
  Plain text file phpbbtemplate.inc Class PHPBB template parsing class for the html output parsing

  Files folder image Files (7)  /  templates  
File Role Description
  Plain text file script_timing.tpl Data Template for the html output

  Files folder image Files (7)  /  Documentation  
File Role Description
  Accessible without login HTML file script_timer.html Doc. Full documentation of all class methods and variables

  Files folder image Files (7)  /  examples  
File Role Description
  Plain text file script_timer_example.php Example Example of how to use the script timer class

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 Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:829
This week:0
All time:4,172
This week:555Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:75%StarStarStarStar
Documentation:75%StarStarStarStar
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:64%StarStarStarStar
Rank:722