time.After one time
Vladimir Bauer
9 years ago
| 339 | 339 | go func(listenCh <-chan int, resultCh chan<- int) { |
| 340 | 340 | defer close(resultCh) |
| 341 | 341 | widths := make([]int, 0, numBars) |
| 342 | abandon := time.After(userRR) | |
| 342 | 343 | loop: |
| 343 | 344 | for { |
| 344 | 345 | select { |
| 347 | 348 | if len(widths) == numBars { |
| 348 | 349 | break loop |
| 349 | 350 | } |
| 350 | case <-time.After(userRR): | |
| 351 | case <-abandon: | |
| 351 | 352 | return |
| 352 | 353 | } |
| 353 | 354 | } |