Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> def bench7():
- ... foo = 0
- ... a = time()
- ... for i in repeat(None):
- ... foo += 1
- ... if foo == 100000000:
- ... break
- ... b = time()
- ... print a, b, b-a
- ...
- >>> def bench8():
- ... foo = 0
- ... a = time()
- ... while True:
- ... foo += 1
- ... if foo == 100000000:
- ... break
- ... b = time()
- ... print a, b, b-a
- ...
- >>> bench7()
- 1326592924.41 1326592935.42 11.0051281452
- >>> bench7()
- 1326592936.36 1326592947.48 11.1183578968
- >>> bench8()
- 1326592951.47 1326592965.03 13.5640599728
- >>> bench8()
- 1326592966.07 1326592979.6 13.5341670513
Add Comment
Please, Sign In to add comment