Skip to content

Commit

Permalink
day 53 - add benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
vaskoz committed Oct 13, 2018
1 parent ba07bc2 commit 83ee3ec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions day53/problem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,15 @@ func TestQueue(t *testing.T) {
}

func BenchmarkQueue(b *testing.B) {
for i := 0; i < b.N; i++ {
for _, tc := range testcases {
q := NewQueue()
for _, v := range tc.inserts {
q.Enqueue(v)
}
for range tc.inserts {
q.Dequeue()
}
}
}
}

0 comments on commit 83ee3ec

Please sign in to comment.