Skip to content

Instantly share code, notes, and snippets.

@egonelbre
Last active October 2, 2018 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egonelbre/bffa9e02282f6623fc1b331a9515feee to your computer and use it in GitHub Desktop.
Save egonelbre/bffa9e02282f6623fc1b331a9515feee to your computer and use it in GitHub Desktop.
for n := 0; n < b.N; n++ {
q := queueimpl7.New()
for k := 0; k < 1000; k++ {
for i := 0; i < test.count; i++ {
q.Push(i)
if test.remove && i > 0 && i%3 == 0 {
tmp, tmp2 = q.Pop()
}
}
var ok bool = true
for ok {
tmp, ok = q.Pop()
}
}
}
for n := 0; n < b.N; n++ {
q := queueimpl7.New()
for i := 0; i < 5411; i++ {
q.Push(i)
}
for k := 0; k < 1000; k+++
for i := 0; i < test.count; i++ {
q.Push(i)
}
for i := 0; i < test.count; i++ {
q.Pop(i)
}
}
var ok bool = true
for ok {
tmp, ok = q.Pop()
}
}
for n := 0; n < b.N; n++ {
q := queueimpl7.New()
for i := 0; i < 5411; i++ {
q.Push(i)
}
for i := 0; i < test.count; i++ {
q.Push(i)
_, _ = q.Pop()
}
var ok bool = true
for ok {
tmp, ok = q.Pop()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment