当前位置:网站首页>go写一个在一定时间内运行的程序
go写一个在一定时间内运行的程序
2022-07-07 05:27:00 【Jimmy_jimi】
目标:打印菱形
执行一个程序,使其在一定时间内一直执行
结果产出:
func main() {
go log.Log2("1","1","1")
start :=time.Now()
time.Sleep(10*time.Millisecond)
fmt.Println(time.Since(start).Milliseconds())
re:
for {
fmt.Println(int(time.Since(start).Milliseconds()))
if int(time.Since(start).Milliseconds())>1000{
break re
}
}
for int(time.Since(start).Milliseconds())>1000{
}
fmt.Println("2")
}
边栏推荐
- MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
- Openjudge noi 2.1 1752: chicken and rabbit in the same cage
- Deit learning notes
- Improve the delivery efficiency of enterprise products (1) -- one click installation and upgrade of enterprise applications
- 机器人教育在动手实践中的真理
- eBPF Cilium实战(2) - 底层网络可观测性
- Famine cloud service management script
- 解析机器人科技发展观对社会研究论
- JS copy picture to clipboard read clipboard
- OpenVSCode云端IDE加入Rainbond一体化开发体系
猜你喜欢
opencv学习笔记一——读取图像的几种方法
Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
Practice of implementing cloud native Devops based on rainbow library app
饥荒云服管理脚本
rsync远程同步
国标GB28181协议视频平台EasyGBS新增拉流超时配置
一文了解如何源码编译Rainbond基础组件
Practice of combining rook CEPH and rainbow, a cloud native storage solution
Easy to understand SSO
Golang 编译约束/条件编译 ( // +build <tags> )
随机推荐
Using nocalhost to develop microservice application on rainbow
Opencv learning note 5 - gradient calculation / edge detection
Golang 编译约束/条件编译 ( // +build <tags> )
Réplication de vulnérabilité - désrialisation fastjson
POJ - 3616 Milking Time(DP+LIS)
拓维信息使用 Rainbond 的云原生落地实践
Rsync remote synchronization
The use of generics and vararg variable parameters in kotlin
The truth of robot education in hands-on practice
Installation and configuration of PLSQL
Rainbond结合NeuVector实践容器安全管理
AVL平衡二叉搜索树
opencv学习笔记四——膨胀/腐蚀/开运算/闭运算
雅思考试自己的复习进度以及方法使用【日更版】
[untitled]
Train your dataset with swinunet
opencv学习笔记二——图像基本操作
The field value in Splunk subquery fuzzy matching CSV is*
grpc、oauth2、openssl、双向认证、单向认证等专栏文章目录
饥荒云服管理脚本