(b *testing.B)
| 66 | } |
| 67 | |
| 68 | func BenchmarkQueue(b *testing.B) { |
| 69 | q := NewQueue(10, 100) |
| 70 | q.Run() |
| 71 | |
| 72 | b.ResetTimer() |
| 73 | b.RunParallel(func(pb *testing.PB) { |
| 74 | for pb.Next() { |
| 75 | job := NewJob("", func(v interface{}) { |
| 76 | _ = v |
| 77 | }) |
| 78 | q.Push(job) |
| 79 | } |
| 80 | }) |
| 81 | q.Terminate() |
| 82 | } |