github.com/powerman/golang-tools@v0.1.11-0.20220410185822-5ad214d8d803/go/pointer/testdata/timer.go (about)

     1  // +build ignore
     2  
     3  package main
     4  
     5  import "time"
     6  
     7  func after() {}
     8  
     9  func main() {
    10  	// @calls time.startTimer -> time.sendTime
    11  	ticker := time.NewTicker(1)
    12  	<-ticker.C
    13  
    14  	// @calls time.startTimer -> time.sendTime
    15  	timer := time.NewTimer(time.Second)
    16  	<-timer.C
    17  
    18  	// @calls time.startTimer -> time.goFunc
    19  	// @calls time.goFunc -> main.after
    20  	timer = time.AfterFunc(time.Second, after)
    21  	<-timer.C
    22  }
    23  
    24  // @calls time.sendTime -> time.Now