Created
June 5, 2014 16:24
-
-
Save mrnugget/a0137670f3b38931674b to your computer and use it in GitHub Desktop.
golang time.After
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"time" | |
) | |
func main() { | |
ticker := time.Tick(100 * time.Millisecond) | |
for { | |
select { | |
case <-ticker: | |
println(".") | |
case <-time.After(1 * time.Second): // BUG | |
println("after called") | |
return | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment