当前位置:网站首页>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")
}
边栏推荐
- Wang Zijian: is the NFT of Tencent magic core worth buying?
- Opencv learning notes II - basic image operations
- PVTV2--Pyramid Vision TransformerV2学习笔记
- Train your dataset with swinunet
- Splunk查询csv lookup table数据动态查询
- 提高企业产品交付效率系列(1)—— 企业应用一键安装和升级
- IP-guard助力能源企业完善终端防泄密措施,保护机密资料安全
- Opencv learning note 4 - expansion / corrosion / open operation / close operation
- 【无标题】
- Domain specific language / DSL in kotlin
猜你喜欢
Opencv learning notes II - basic image operations
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
Golang 编译约束/条件编译 ( // +build <tags> )
Give full play to the wide practicality of maker education space
National standard gb28181 protocol video platform easygbs adds streaming timeout configuration
Deit learning notes
Tuowei information uses the cloud native landing practice of rainbow
Analysis of maker education in innovative education system
GFS distributed file system
One click deployment of highly available emqx clusters in rainbow
随机推荐
Application of slip ring of shipborne radar antenna
[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
解析创新教育体系中的创客教育
rsync远程同步
Rsync remote synchronization
GFS分布式文件系统
Easy to understand SSO
Kotlin combines flatmap for filtering and zip merge operators
Detailed explanation of apply, also, let, run functions and principle analysis of internal source code in kotlin
Open3D ISS关键点
解读创客思维与数学课程的实际运用
拓维信息使用 Rainbond 的云原生落地实践
探索STEAM艺术设计中的创造力
Opencv learning notes II - basic image operations
Improve the delivery efficiency of enterprise products (1) -- one click installation and upgrade of enterprise applications
opencv学习笔记四——膨胀/腐蚀/开运算/闭运算
Snyk 依赖性安全漏洞扫描工具
打通法律服务群众“最后一公里”,方正璞华劳动人事法律自助咨询服务平台频获“点赞”
Lua programming learning notes
IP-guard助力能源企业完善终端防泄密措施,保护机密资料安全