Created
October 8, 2019 15:52
-
-
Save fpawel/c060722af9f116e38dd99afb707e1969 to your computer and use it in GitHub Desktop.
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 ( | |
"fmt" | |
"time" | |
"syscall" | |
) | |
func main() { | |
ticker := time.NewTicker(time.Second) | |
go func() { | |
for t := range ticker.C { | |
fmt.Print(syscall.Gettid(), " ") | |
} | |
}() | |
time.Sleep(time.Second * 10) | |
ticker.Stop() | |
} | |
// выводит: | |
// 70 70 70 70 70 70 70 69 69 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment