How do I make a counter in PHP for execution time?
This script took: <time>
??
Counter in PHP
Started by dirkfirst, Aug 10 2006 07:01 AM
3 replies to this topic
#1
Posted 10 August 2006 - 07:01 AM
|
|
|
#2
Guest_chaganlal1_*
Posted 10 August 2006 - 09:14 AM
Guest_chaganlal1_*
#3
Guest_NeedHelp_*
Posted 10 August 2006 - 01:17 PM
Guest_NeedHelp_*
Here is a function I modified to do it:
And then in your php do
// Determine start time
function slog_time() {
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
// Return our time
return $starttime;
}
// Determine end time
function elog_time($starttime) {
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
// Return our display
return $totaltime;
And then in your php do
// Get time in HEADER $startTime = slog_time(); // Your php code here ..................... // Get total time in FOOTER $totalTime = elog_time($startTime); // Display it print "Execution Time: $totalTime Seconds<br />";
#4
Posted 10 August 2006 - 04:28 PM
Nice work n needhelp


Sign In
Create Account


Back to top









