在循环中怎样让一个变量五秒之后重新赋值而不阻塞程序的运行
...
var i int64
go func() {
for {
i = changeI()
time.Sleep(5 * time.Second)
}
}()
...
#5
更多评论
for {
var a int = 0
go f(p *int){
time.Sleep(5*time.Second)
*p = 1
}(&a)
xxxx
xxxx
}
#2