Friday, 6 October 2017

Printing the time between 2 points in a program in Python

I would like to know a way to time between two points in a program. In my situation I will ask the user 10 questions and after display the time it took for them to answer the question (example code below). How would i do this through something like import time ?


Example code:


timer.start
question1 = input("What is your favorite game ?")
timer.end
print(timer.time)

^
The timer.x thing is going to be replaced with your suggestions.

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...