From 31e7f691836caf6ab04d4cbca86548f16707f2d1 Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Fri, 28 Jun 2024 21:07:23 +0200 Subject: [PATCH] doc --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e67696ee..e4869dc4 100644 --- a/README.md +++ b/README.md @@ -2849,16 +2849,24 @@ laterTrue := func(i int) bool { return i > 5 } -ok := lo.WaitFor(alwaysTrue, 10*time.Millisecond, time.Millisecond) +iterations, duration, ok := lo.WaitFor(alwaysTrue, 10*time.Millisecond, time.Millisecond) +// 1 +// 0ms // true ok := lo.WaitFor(alwaysFalse, 10*time.Millisecond, time.Millisecond) +// 10 +// 10ms // false ok := lo.WaitFor(laterTrue, 10*time.Millisecond, time.Millisecond) +// 7 +// 7ms // true ok := lo.WaitFor(laterTrue, 10*time.Millisecond, 5*time.Millisecond) +// 2 +// 10ms // false ```