Skip to content

Commit cf4e165

Browse files
committed
Add IncrementInt benchmark
1 parent 901b241 commit cf4e165

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cache_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,16 @@ func BenchmarkRWMutexMapSetDeleteSingleLock(b *testing.B) {
15921592
}
15931593
}
15941594

1595+
func BenchmarkIncrementInt(b *testing.B) {
1596+
b.StopTimer()
1597+
tc := New(DefaultExpiration, 0)
1598+
tc.Set("foo", 0, DefaultExpiration)
1599+
b.StartTimer()
1600+
for i := 0; i < b.N; i++ {
1601+
tc.IncrementInt("foo", 1)
1602+
}
1603+
}
1604+
15951605
func BenchmarkDeleteExpired(b *testing.B) {
15961606
b.StopTimer()
15971607
tc := New(1, 0)

0 commit comments

Comments
 (0)