1import timeit
2import_module = "import random"
3testcode = '''
4def test():
5 return random.randint(10, 100)
6'''
7print(timeit.repeat(stmt=testcode, setup=import_module))
8
1# Timeit can't be used for whole file using command line...
2# You can only test python snippets using command line