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: 828 All time: 4,171 This week: 182Up
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: 50
All time rank: 54714 in The Netherlands The Netherlands
Week rank: 312 Up10 in The Netherlands The Netherlands Up

Screenshots  
  • 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 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  /  classes  
File Role Description
  Plain text file phpbbtemplate.inc 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  
 0%
Total:828
This week:0
All time:4,171
This week:182Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:75%StarStarStarStar
Documentation:75%StarStarStarStar
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:64%StarStarStarStar
Rank:722