当前位置:网站首页>Go write a program that runs within a certain period of time
Go write a program that runs within a certain period of time
2022-07-07 08:32:00 【Jimmy_ jimi】
The goal is : Print diamond
Execute a program , Keep it running for a certain period of time
Result output :
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")
}
边栏推荐
- Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
- How to realize the high temperature alarm of the machine room in the moving ring monitoring system
- 在 Rainbond 中一键安装高可用 Nacos 集群
- Are you holding back on the publicity of the salary system for it posts such as testing, development, operation and maintenance?
- Iptables' state module (FTP service exercise)
- [quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
- grpc、oauth2、openssl、双向认证、单向认证等专栏文章目录
- The single value view in Splunk uses to replace numeric values with text
- [quick start of Digital IC Verification] 14. Basic syntax of SystemVerilog learning 1 (array, queue, structure, enumeration, string... Including practical exercises)
- POJ - 3784 Running Median(对顶堆)
猜你喜欢
Battery and motor technology have received great attention, but electric control technology is rarely mentioned?
Opencv learning note 5 - gradient calculation / edge detection
opencv学习笔记一——读取图像的几种方法
[quick start of Digital IC Verification] 10. Verilog RTL design must know FIFO
SSM 整合
Practice of implementing cloud native Devops based on rainbow library app
饥荒云服管理脚本
2 - 3 arbre de recherche
Opencv learning note 4 - expansion / corrosion / open operation / close operation
AVL平衡二叉搜索树
随机推荐
Don't stop chasing the wind and the moon. Spring mountain is at the end of Pingwu
在 Rainbond 中一键安装高可用 Nacos 集群
[IELTS speaking] Anna's oral learning records part2
Open3d ISS key points
2 - 3 arbre de recherche
OpenVSCode云端IDE加入Rainbond一体化开发体系
Data type - integer (C language)
国标GB28181协议视频平台EasyGBS新增拉流超时配置
Go语言中,函数是一种类型
Lua 编程学习笔记
It's too true. There's a reason why I haven't been rich
Splunk子查询模糊匹配csv中字段值为*
2-3查找樹
Xcit learning notes
如何理解分布式架构和微服务架构呢
Kotlin combines flatmap for filtering and zip merge operators
XCiT学习笔记
一种适用于应用频繁测试下快速查看Pod的日志的方法(grep awk xargs kuberctl)
Famine cloud service management script
[untitled]