PHP Classes

Script timer: Measure the time a script takes to execute

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


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: 50
All time rank: 54714 in The Netherlands The Netherlands
Week rank: 280 Up7 in The Netherlands The Netherlands Up

  • sample_output.gif
  Files folder image Files  
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 Class Class file
Plain text file Class Class file without the docblock documentation

  Files folder image Files  /  classes  
File Role Description
  Plain text file Class PHPBB template parsing class for the html output parsing

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

  Files folder image Files  /  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  /  examples  
File Role Description
  Plain text file script_timer_example.php Example Example of how to use the script timer class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,171
This week:555Up
 User Ratings  
 All time