/ Published in: PHP
Place startTime() at beginning where timing is to start. Get the return value and set the start time variable. At end of script to time call execTime($start) passing the start time and this will calculate elapsed time of execution.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function startTime() { $secs = $mtime[1] + $mtime[0]; return $secs; } function execTime($start) { $end = startTime(); $total = $end - $start; } //Usage $start = startTime(); //the code..... echo execTime($start);