Skip to content

Instantly share code, notes, and snippets.

@fpawel
Created October 8, 2019 15:52
Show Gist options
  • Save fpawel/c060722af9f116e38dd99afb707e1969 to your computer and use it in GitHub Desktop.
Save fpawel/c060722af9f116e38dd99afb707e1969 to your computer and use it in GitHub Desktop.
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