Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Jun 30, 2024
1 parent b04e48c commit 8f1405f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3072,22 +3072,22 @@ laterTrue := func(i int) bool {
return i > 5
}

iterations, duration, ok := lo.WaitForWithContext(alwaysTrue, 10*time.Millisecond, time.Millisecond)
iterations, duration, ok := lo.WaitForWithContext(ctx, alwaysTrue, 10*time.Millisecond, time.Millisecond)
// 1
// 0ms
// true

iterations, duration, ok := lo.WaitForWithContext(alwaysFalse, 10*time.Millisecond, time.Millisecond)
iterations, duration, ok := lo.WaitForWithContext(ctx, alwaysFalse, 10*time.Millisecond, time.Millisecond)
// 10
// 10ms
// false

iterations, duration, ok := lo.WaitForWithContext(laterTrue, 10*time.Millisecond, time.Millisecond)
iterations, duration, ok := lo.WaitForWithContext(ctx, laterTrue, 10*time.Millisecond, time.Millisecond)
// 7
// 7ms
// true

iterations, duration, ok := lo.WaitForWithContext(laterTrue, 10*time.Millisecond, 5*time.Millisecond)
iterations, duration, ok := lo.WaitForWithContext(ctx, laterTrue, 10*time.Millisecond, 5*time.Millisecond)
// 2
// 10ms
// false
Expand Down

0 comments on commit 8f1405f

Please sign in to comment.