add total time and print the sql