Last active
December 5, 2018 13:27
-
-
Save vharsh/8c19bb6e04019b4595bfea24e2910924 to your computer and use it in GitHub Desktop.
the 10 seconds tick
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" | |
import "fmt" | |
func ticks() { | |
ticker := time.NewTicker(10 * time.Second) | |
for t := range ticker.C { | |
fmt.Println("Tick at", t) | |
} | |
} | |
func main() { | |
go ticks() | |
// This program is able to make 9 ticks, from time ZERO | |
time.Sleep(100 * time.Second) | |
} |
Author
vharsh
commented
Dec 5, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment