Skip to content

Instantly share code, notes, and snippets.

@pedrobertao
Last active September 22, 2024 14:09
Show Gist options
  • Save pedrobertao/d435d9f1b0915cbc1cb54bc385f45104 to your computer and use it in GitHub Desktop.
Save pedrobertao/d435d9f1b0915cbc1cb54bc385f45104 to your computer and use it in GitHub Desktop.
Fibonacci Benchmark Test
func BenchmarkFibRecursive(b *testing.B) {
for i := 0; i < b.N; i++ {
fibRecursive(uint(10))
}
}
func BenchmarkFibIterative(b *testing.B) {
for i := 0; i < b.N; i++ {
fibIterative(uint(10))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment