At the start of the script, make a note of the time.
At the end of the script, make another note of the time.
The difference between the times is the total execution time as measured against the Gregorian calendar (not CPU time spent on that process, not just PHP time, but wall clock time) - less the amount of time it took to do the subtraction and print the result and anything following it.