File tree 2 files changed +5
-17
lines changed
2 files changed +5
-17
lines changed Original file line number Diff line number Diff line change 995
995
* [ Sol1] ( project_euler/problem_686/sol1.py )
996
996
997
997
## Quantum
998
+ * [ Bb84] ( quantum/bb84.py )
998
999
* [ Deutsch Jozsa] ( quantum/deutsch_jozsa.py )
999
1000
* [ Half Adder] ( quantum/half_adder.py )
1000
1001
* [ Not Gate] ( quantum/not_gate.py )
Original file line number Diff line number Diff line change @@ -38,26 +38,13 @@ def atbash(sequence: str) -> str:
38
38
39
39
40
40
def benchmark () -> None :
41
- """Let's benchmark them side-by-side..."""
41
+ """Let's benchmark our functions side-by-side..."""
42
42
from timeit import timeit
43
43
44
44
print ("Running performance benchmarks..." )
45
- print (
46
- "> atbash_slow()" ,
47
- timeit (
48
- "atbash_slow(printable)" ,
49
- setup = "from string import printable ; from __main__ import atbash_slow" ,
50
- ),
51
- "seconds" ,
52
- )
53
- print (
54
- "> atbash()" ,
55
- timeit (
56
- "atbash(printable)" ,
57
- setup = "from string import printable ; from __main__ import atbash" ,
58
- ),
59
- "seconds" ,
60
- )
45
+ setup = "from string import printable ; from __main__ import atbash, atbash_slow"
46
+ print (f"> atbash_slow(): { timeit ('atbash_slow(printable)' , setup = setup )} seconds" )
47
+ print (f"> atbash(): { timeit ('atbash(printable)' , setup = setup )} seconds" )
61
48
62
49
63
50
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments