Category: >> PHP Code >> Measure script run time Bookmark and Share

<< lastnext >>

Snippet Name: Measure script run time

Description: Measure the run time of a function or script process.

Also see:
» Simple directory viewer / browser
» Read a web page directly in to a s...
» Recursive Directory Browser
» Saving Remote Images With PHP
» Include All Files In A Directory
» More File Type Detection in PHP
» Get Current Page URL
» Get Current Directory Name
» Write to File example
» Check if a file exists
» Export table to Excel or MS Word f...
» Count lines in file
» Copy File From Server
» Remove All Files An A Given Direct...
» Calculate File/Folder Size In A Di...

Comment: (none)

Author: CoderZone
Language: PHP
Highlight Mode: PHP
Last Modified: March 16th, 2009

// mark the start time
$start_time = microtime(true);
// ...function or processing code...
// mark the stop time
$stop_time = microtime(true);
// get the difference in seconds
$time = $stop_time - $start_time;
print "Elapsed time was $time seconds.";
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© | users online: 6