当前位置:网站首页>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")
}
边栏推荐
- Automatic upgrading of database structure in rainbow
- Implementation of navigation bar at the bottom of applet
- opencv学习笔记二——图像基本操作
- Lua programming learning notes
- 利用 Helm 在各类 Kubernetes 中安装 Rainbond
- 数据中台落地实施之法
- Splunk查询csv lookup table数据动态查询
- IP-guard助力能源企业完善终端防泄密措施,保护机密资料安全
- Offer harvester: add and sum two long string numbers (classic interview algorithm question)
- [go ~ 0 to 1] obtain timestamp, time comparison, time format conversion, sleep and timer on the seventh day
猜你喜欢
Caractéristiques de bisenet
Rainbow combines neuvector to practice container safety management
Xcit learning notes
Rsync remote synchronization
[IELTS speaking] Anna's oral learning records part2
[quick start of Digital IC Verification] 13. SystemVerilog interface and program learning
[hard core science popularization] working principle of dynamic loop monitoring system
Golang 编译约束/条件编译 ( // +build <tags> )
Are you holding back on the publicity of the salary system for it posts such as testing, development, operation and maintenance?
opencv学习笔记五——梯度计算/边缘检测
随机推荐
Rsync remote synchronization
[kuangbin]专题十五 数位DP
One click installation of highly available Nacos clusters in rainbow
Automatic upgrading of database structure in rainbow
Analysis of maker education in innovative education system
解读创客思维与数学课程的实际运用
Grpc, oauth2, OpenSSL, two-way authentication, one-way authentication and other column directories
饥荒云服管理脚本
Virtual address space
The reified keyword in kotlin is used for generics
How to understand distributed architecture and micro service architecture
Easy to understand SSO
Full text query classification
[quick start of Digital IC Verification] 14. Basic syntax of SystemVerilog learning 1 (array, queue, structure, enumeration, string... Including practical exercises)
Splunk查询csv lookup table数据动态查询
Kotlin combines flatmap for filtering and zip merge operators
National standard gb28181 protocol video platform easygbs adds streaming timeout configuration
Implement your own dataset using bisenet
Domain specific language / DSL in kotlin
Explore creativity in steam art design