mirror of
https://github.com/patrickmn/go-cache.git
synced 2026-04-22 22:57:09 +08:00
Add IncrementInt benchmark
This commit is contained in:
@@ -1592,6 +1592,16 @@ func BenchmarkRWMutexMapSetDeleteSingleLock(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkIncrementInt(b *testing.B) {
|
||||
b.StopTimer()
|
||||
tc := New(DefaultExpiration, 0)
|
||||
tc.Set("foo", 0, DefaultExpiration)
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
tc.IncrementInt("foo", 1)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkDeleteExpired(b *testing.B) {
|
||||
b.StopTimer()
|
||||
tc := New(1, 0)
|
||||
|
||||
Reference in New Issue
Block a user