Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for BenchmarkCache (0.36 sec)

  1. internal/cachevalue/cache_test.go

    	}
    
    	time.Sleep(3 * time.Second)
    	t3, _ := cache.Get()
    
    	if t1.Equal(t3) {
    		t.Fatalf("expected time to be un-equal: %s == %s", t1, t3)
    	}
    }
    
    func BenchmarkCache(b *testing.B) {
    	cache := New[time.Time]()
    	cache.InitOnce(1*time.Millisecond, Opts{},
    		func(ctx context.Context) (time.Time, error) {
    			return time.Now(), nil
    		},
    	)
    
    	b.ReportAllocs()
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu May 09 00:51:34 UTC 2024
    - 2.7K bytes
    - Viewed (0)
Back to top