mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 12:17:53 +08:00
22 lines
275 B
Go
22 lines
275 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Println("start:", time.Now())
|
|
index := 0
|
|
ticker := time.NewTicker(10 * time.Millisecond)
|
|
for {
|
|
<-ticker.C
|
|
index++
|
|
fmt.Println(index)
|
|
if index == 100 {
|
|
break
|
|
}
|
|
}
|
|
fmt.Println(" end:", time.Now())
|
|
}
|