Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> cProfile('cProfile.run(\'bits_strings(1000, 1000)\')')
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- TypeError: 'module' object is not callable
- >>> cProfile.run('cProfile.run(\'bits_strings(1000, 1000)\')')
- 1005005 function calls in 0.186 seconds
- Ordered by: standard name
- ncalls tottime percall cumtime percall filename:lineno(function)
- 1 0.000 0.000 0.780 0.780 <stdin>:1(bits_strings)
- 1000 0.001 0.000 0.776 0.001 <stdin>:1(chrs)
- 1001 0.001 0.000 0.780 0.001 <stdin>:2(<genexpr>)
- 1 0.000 0.000 0.780 0.780 <string>:1(<module>)
- 1000000 0.086 0.000 0.086 0.000 {chr}
- 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
- 1000 0.003 0.000 0.003 0.000 {method 'getrandbits' of '_random.Random' objects}
- 1000 0.090 0.000 0.771 0.001 {method 'join' of 'str' objects}
- 1001 0.004 0.000 0.004 0.000 {range}
- 5 function calls in 0.781 seconds
- Ordered by: standard name
- ncalls tottime percall cumtime percall filename:lineno(function)
- 1 0.000 0.000 0.781 0.781 <string>:1(<module>)
- 1 0.000 0.000 0.781 0.781 cProfile.py:132(run)
- 1 0.000 0.000 0.781 0.781 cProfile.py:137(runctx)
- 1 0.000 0.000 0.781 0.781 cProfile.py:14(run)
- 1 0.781 0.781 0.781 0.781 {method 'enable' of '_lsprof.Profiler' objects}
- >>> def chrs(bits, len_string):
- ... return ''.join(chr((bits >> (8*x)) & 0xff) for x in range(len_string))
- ...
- >>> cProfile.run('cProfile.run(\'bits_strings(1000, 1000)\')')
- 2005004 function calls in 0.844 seconds
- Ordered by: standard name
- ncalls tottime percall cumtime percall filename:lineno(function)
- 1 0.000 0.000 0.846 0.846 <stdin>:1(bits_strings)
- 1000 0.001 0.000 0.841 0.001 <stdin>:1(chrs)
- 1001000 0.638 0.000 0.733 0.000 <stdin>:2(<genexpr>)
- 1 0.000 0.000 0.846 0.846 <string>:1(<module>)
- 1000000 0.095 0.000 0.095 0.000 {chr}
- 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
- 1000 0.003 0.000 0.003 0.000 {method 'getrandbits' of '_random.Random' objects}
- 1000 0.102 0.000 0.835 0.001 {method 'join' of 'str' objects}
- 1001 0.004 0.000 0.004 0.000 {range}
- 5 function calls in 0.846 seconds
- Ordered by: standard name
- ncalls tottime percall cumtime percall filename:lineno(function)
- 1 0.000 0.000 0.846 0.846 <string>:1(<module>)
- 1 0.000 0.000 0.846 0.846 cProfile.py:132(run)
- 1 0.000 0.000 0.846 0.846 cProfile.py:137(runctx)
- 1 0.000 0.000 0.846 0.846 cProfile.py:14(run)
- 1 0.846 0.846 0.846 0.846 {method 'enable' of '_lsprof.Profiler' objects}
Advertisement
Add Comment
Please, Sign In to add comment