优化ttlcache

This commit is contained in:
刘祥超
2022-04-09 18:44:51 +08:00
parent ded2f98cce
commit dba9c2c47d
4 changed files with 15 additions and 2 deletions

View File

@@ -165,6 +165,13 @@ func TestCache_GC2(t *testing.T) {
}
}
func TestCacheDestroy(t *testing.T) {
var cache = NewCache()
t.Log("count:", SharedManager.Count())
cache.Destroy()
t.Log("count:", SharedManager.Count())
}
func BenchmarkNewCache(b *testing.B) {
runtime.GOMAXPROCS(1)