(b *testing.B)
| 1680 | } |
| 1681 | |
| 1682 | func BenchmarkDeleteExpiredLoop(b *testing.B) { |
| 1683 | b.StopTimer() |
| 1684 | tc := New(5*time.Minute, 0) |
| 1685 | tc.mu.Lock() |
| 1686 | for i := 0; i < 100000; i++ { |
| 1687 | tc.set(strconv.Itoa(i), "bar", DefaultExpiration) |
| 1688 | } |
| 1689 | tc.mu.Unlock() |
| 1690 | b.StartTimer() |
| 1691 | for i := 0; i < b.N; i++ { |
| 1692 | tc.DeleteExpired() |
| 1693 | } |
| 1694 | } |
| 1695 | |
| 1696 | func TestGetWithExpiration(t *testing.T) { |
| 1697 | tc := New(DefaultExpiration, 0) |
nothing calls this directly
no test coverage detected