Pages

Saturday, December 17, 2016

What is GOOGLE?

import time # function to start the stopwatch def start_stopwatch(): start_time = time.time() return start_time # function to stop the stopwatch and calculate elapsed time def stop_stopwatch(start_time): elapsed_time = time.time() - start_time return elapsed_time # example usage print("Press enter to start the stopwatch...") input() start_time = start_stopwatch() print("Stopwatch started. Press enter to stop...") input() elapsed_time = stop_stopwatch(start_time) print("Elapsed time:", elapsed_time, "seconds")