Interactively compare both fibonacci generators
(n: int)
| 56 | |
| 57 | |
| 58 | def compareFibonacciCalculators(n: int) -> None: |
| 59 | """ |
| 60 | Interactively compare both fibonacci generators |
| 61 | """ |
| 62 | |
| 63 | startI = time.clock() |
| 64 | resultI = getFibonacciIterative(n) |
| 65 | endI = time.clock() |
| 66 | |
| 67 | startR = time.clock() |
| 68 | resultR = getFibonacciRecursive(n) |
| 69 | endR = time.clock() |
| 70 | |
| 71 | s = "{} calculting {} => {} in {} seconds" |
| 72 | print(s.format("Iteratively", n, resultI, endI - startI)) |
| 73 | print(s.format("Recursively", n, resultR, endR - startR)) |
nothing calls this directly
no test coverage detected