Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> cProfile.run('bits_strings(1000, 1000)')
- 2004004 function calls in 0.761 seconds
- Ordered by: standard name
- ncalls tottime percall cumtime percall filename:lineno(function)
- 1 0.000 0.000 0.762 0.762 <stdin>:1(bits_strings)
- 1000 0.002 0.000 0.758 0.001 <stdin>:1(chrs)
- 1001000 0.583 0.000 0.664 0.000 <stdin>:2(<genexpr>)
- 1 0.000 0.000 0.762 0.762 <string>:1(<module>)
- 1000000 0.081 0.000 0.081 0.000 {built-in method builtins.chr}
- 1 0.000 0.000 0.762 0.762 {built-in method builtins.exec}
- 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.092 0.000 0.756 0.001 {method 'join' of 'str' objects}
- >>> def chrs(bits, len_string):
- ... return ''.join(chr((bits >> (8*offset)) & 0xff) for offset in range(len_string))
- ...
- >>> cProfile.run('bits_strings(1000, 1000)')
- 1004005 function calls in 0.178 seconds
- Ordered by: standard name
- ncalls tottime percall cumtime percall filename:lineno(function)
- 1 0.000 0.000 0.755 0.755 <stdin>:1(bits_strings)
- 1000 0.002 0.000 0.751 0.001 <stdin>:1(chrs)
- 1001 0.001 0.000 0.755 0.001 <stdin>:2(<genexpr>)
- 1 0.000 0.000 0.756 0.756 <string>:1(<module>)
- 1000000 0.080 0.000 0.080 0.000 {built-in method builtins.chr}
- 1 0.000 0.000 0.756 0.756 {built-in method builtins.exec}
- 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.092 0.000 0.750 0.001 {method 'join' of 'str' objects}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement