当前位置:网站首页>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")
}
边栏推荐
- eBPF Cilium实战(1) - 基于团队的网络隔离
- MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
- opencv学习笔记四——膨胀/腐蚀/开运算/闭运算
- [quick start of Digital IC Verification] 14. Basic syntax of SystemVerilog learning 1 (array, queue, structure, enumeration, string... Including practical exercises)
- Rainbow combines neuvector to practice container safety management
- Rainbow version 5.6 was released, adding a variety of installation methods and optimizing the topology operation experience
- Snyk 依赖性安全漏洞扫描工具
- Iptables' state module (FTP service exercise)
- Offer harvester: add and sum two long string numbers (classic interview algorithm question)
- [quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
猜你喜欢
随机推荐
opencv学习笔记一——读取图像的几种方法
SSM 整合
如何理解分布式架构和微服务架构呢
PVTV2--Pyramid Vision TransformerV2学习笔记
单元测试报告成功率低
Zcmu--1492: problem d (C language)
[quick start of Digital IC Verification] 14. Basic syntax of SystemVerilog learning 1 (array, queue, structure, enumeration, string... Including practical exercises)
Input and output of floating point data (C language)
opencv学习笔记四——膨胀/腐蚀/开运算/闭运算
ES6_ Arrow function
【Go ~ 0到1 】 第七天 获取时间戳,时间比较,时间格式转换,Sleep与定时器
2-3 lookup tree
grpc、oauth2、openssl、双向认证、单向认证等专栏文章目录
Opencv learning note 3 - image smoothing / denoising
Open3D ISS关键点
归并排序和非比较排序
Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
Splunk query CSV lookup table data dynamic query
一种适用于应用频繁测试下快速查看Pod的日志的方法(grep awk xargs kuberctl)
Rainbow version 5.6 was released, adding a variety of installation methods and optimizing the topology operation experience









