18 lines
318 B
Python
18 lines
318 B
Python
import time
|
|
|
|
def intrptWIN():
|
|
procDone = False
|
|
n = 0
|
|
|
|
while not procDone:
|
|
try:
|
|
time.sleep(0.5)
|
|
n += 1
|
|
print n
|
|
except KeyboardInterrupt, e:
|
|
procDone = True
|
|
|
|
t1 = time.time()
|
|
intrptWIN()
|
|
tdelt = time.time() - t1
|
|
print 'Program has run for %5.3f seconds.' % tdelt
|