Execution time calculated only if it's displayed

It's useless to calculate the execution time if it is not displayed.

I move the code for calculate time inside the if(debug) statement.