diff --git a/core/syncx/once_test.go b/core/syncx/once_test.go index b89d701a..15f8f869 100644 --- a/core/syncx/once_test.go +++ b/core/syncx/once_test.go @@ -18,3 +18,15 @@ func TestOnce(t *testing.T) { assert.Equal(t, 1, v) } + +func BenchmarkOnce(b *testing.B) { + var v int + add := Once(func() { + v++ + }) + b.ResetTimer() + for i:=0;i