summaryrefslogtreecommitdiff
path: root/stack_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'stack_test.go')
-rw-r--r--stack_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/stack_test.go b/stack_test.go
index 31e6ff7..bdb5c0e 100644
--- a/stack_test.go
+++ b/stack_test.go
@@ -86,3 +86,21 @@ func BenchmarkPushPopAlot(b *testing.B) {
s.Pop()
}
}
+
+func BenchmarkInsetPopSingle(b *testing.B) {
+ s := NewStack()
+ for i := 0; i < b.N; i++ {
+ s.Insert(1)
+ s.Pop()
+ }
+}
+
+func BenchmarkInsetPopAlot(b *testing.B) {
+ s := NewStack()
+ for i := 0; i < b.N; i++ {
+ s.Insert(i)
+ }
+ for i := 0; i < b.N; i++ {
+ s.Pop()
+ }
+}