当前位置:网站首页>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")
}
边栏推荐
- Obsidan之数学公式的输入
- Easy to understand SSO
- JS copy picture to clipboard read clipboard
- Vulnerability recurrence easy_ tornado
- Caractéristiques de bisenet
- Open3D ISS关键点
- CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
- Thirteen forms of lambda in kotlin
- 解读创客思维与数学课程的实际运用
- How to understand distributed architecture and micro service architecture
猜你喜欢
打通法律服务群众“最后一公里”,方正璞华劳动人事法律自助咨询服务平台频获“点赞”
发挥创客教育空间的广泛实用性
Learn how to compile basic components of rainbow from the source code
[quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
[IELTS speaking] Anna's oral learning records part2
Application of slip ring of shipborne radar antenna
MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
Lua programming learning notes
Open3D ISS关键点
[quick start of Digital IC Verification] 14. Basic syntax of SystemVerilog learning 1 (array, queue, structure, enumeration, string... Including practical exercises)
随机推荐
Installation and configuration of PLSQL
Full text query classification
Splunk子查询模糊匹配csv中字段值为*
Openjudge noi 2.1 1752: chicken and rabbit in the same cage
解析创新教育体系中的创客教育
2 - 3 arbre de recherche
Train your dataset with swinunet
Rainbond 5.7.1 支持对接多家公有云和集群异常报警
SSM integration
Rainbow combines neuvector to practice container safety management
The field value in Splunk subquery fuzzy matching CSV is*
Learn how to compile basic components of rainbow from the source code
CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
POJ - 3616 Milking Time(DP+LIS)
Using nocalhost to develop microservice application on rainbow
Analysis of maker education in innovative education system
Lua programming learning notes
Splunk查询csv lookup table数据动态查询
2-3查找树
[quick start of Digital IC Verification] 10. Verilog RTL design must know FIFO