// WaitFor blocks until the counter is 0 or less. If the block takes longer than
// the given timeout, WaitFor will return false. If duration is 0, Wait is called.
WaitFor blocks until the counter is 0 or less. If the block takes longer than
the given timeout, WaitFor will return false. If duration is 0, Wait is called.
// WaitFor blocks until the counter is 0 or less . If the block takes longer than // the given timeout WaitFor will return false . If duration is 0 Wait is called .
func (wg *WaitGroup) WaitFor(timeout time.Duration) bool {
	if timeout == time.Duration(0) {
		wg.Wait()
		return true 
	}
	start := time.Now()
	spin := NewSpinner(SpinPriorityHigh)
	for wg.Active() {
		if time.Since(start) > timeout {
			return false 
		}
		spin.Yield()
	}
	return true
}
func ( wg * WaitGroup ) WaitFor ( timeout time . Duration ) bool { if timeout == time . Duration ( 0 ) { wg . Wait ( ) return true } start := time . Now ( ) spin := NewSpinner ( SpinPriorityHigh ) for wg . Active ( ) { if time . Since ( start ) > timeout { return false } spin . Yield ( ) } return true }
WaitFor blocks until the counter is 0 or less.
WaitFor blocks until the counter is 0 or less .
// ### return, always true ### // ### return, timed out ###