Advertisement
kopyl

Untitled

Apr 8th, 2021
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. import time, timeit
  2.  
  3. def test():
  4.     time.sleep(1)
  5.  
  6. all_executions = timeit.repeat(
  7.     setup="from __main__ import test",
  8.     stmt="test()", repeat=2, number=1
  9. )
  10.  
  11. average = sum(all_executions) / len(all_executions)
  12.  
  13. print(average)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement