go的time.After异步等候
点击查看代码
package main
import (
"fmt"
"time"
)
func main() {
select {
case <- time.After(time.Second*3): // 异步等候
fmt.Println("after")
}
}
写入自己的博客中才能记得长久
package main
import (
"fmt"
"time"
)
func main() {
select {
case <- time.After(time.Second*3): // 异步等候
fmt.Println("after")
}
}