package main
import (
"fmt"
"time"
)
const MAXSLEEP = 128
func main() {
for numsec := 1; numsec <= MAXSLEEP; numsec <<= 1 {
// TODO
if numsec <= MAXSLEEP/2 {
time.Sleep(time.Second * time.Duration(numsec))
fmt.Println("slepp time(s):", numsec)
}
}
}
- 本文固定链接: https://phpmianshi.com/?id=557
- 转载请注明: golang中国 于 PHP面试网 发表
《本文》有 4055 条评论