diff --git a/bench/bench_test.go b/bench/bench_test.go deleted file mode 100644 index 86392fc..0000000 --- a/bench/bench_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package bench - -import ( - "testing" - "time" - - "github.com/ReneKroon/ttlcache" -) - -func BenchmarkCacheSetWithoutTTL(b *testing.B) { - cache := ttlcache.NewCache() - defer cache.Close() - - for n := 0; n < b.N; n++ { - cache.Set(string(n%1000000), "value") - } -} - -func BenchmarkCacheSetWithGlobalTTL(b *testing.B) { - cache := ttlcache.NewCache() - defer cache.Close() - - cache.SetTTL(time.Duration(50 * time.Millisecond)) - for n := 0; n < b.N; n++ { - cache.Set(string(n%1000000), "value") - } -} - -func BenchmarkCacheSetWithTTL(b *testing.B) { - cache := ttlcache.NewCache() - defer cache.Close() - - for n := 0; n < b.N; n++ { - cache.SetWithTTL(string(n%1000000), "value", time.Duration(50*time.Millisecond)) - } -}