Simulate Stopwatch Program
a. Desc -> Write a Stopwatch Program for measuring the time that elapses between the
start and end clicks
b. I/P -> Start the Stopwatch and End the Stopwatch
c. Logic -> Measure the elapsed time between start and end
d. O/P -> Print the elapsed time.
Please tell code in python language
Answers
Answered by
0
Answer:
To get the CPU time used by a task within a C application, use: clock_t begin = clock(); /* here, do your time-consuming job */ clock_t end = clock(); double time_spent = (double)(end - begin) / CLOCKS_PER_SEC; Note that this returns the time as a floating point type.
Similar questions