Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. package deck
  2.  
  3. import (
  4. "testing"
  5. )
  6.  
  7. func BenchmarkGC(b *testing.B) {
  8. b.ReportAllocs()
  9. shuffled := 0
  10.  
  11. for i := 0; i < b.N; i++ {
  12. d := NewDeck(100)
  13. _, _ = d.Draw()
  14. shuffled += int(d.shuffled)
  15. }
  16.  
  17. b.ReportMetric(float64(shuffled)/float64(b.N), "shuffle/op")
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement