
November 19th, 2012, 03:45 PM
|
 |
Contributing User
|
|
|
|
One idea:
Code:
import time
import sys
# make this work with Python2 or Python3
if sys.version_info[0] < 3:
input = raw_input
# seconds since epoch now at start
start = time.time()
# a silly game to test the counter
a = input("Enter your name: ")
b = input("Enter your age: ")
c = input("Enter your weight: ")
d = input("What year were you born? ")
e = input("What is capitol of France? ")
# the game is finished get seconds since epoch now
end = time.time()
elapsed = end - start
print("This game took %d minutes and %d seconds" % (divmod(elapsed, 60)))
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
|