当前位置:网站首页>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")
}
边栏推荐
- JS copy picture to clipboard read clipboard
- IELTS review progress and method use [daily revision]
- [kuangbin]专题十五 数位DP
- Splunk子查询模糊匹配csv中字段值为*
- Opencv learning notes II - basic image operations
- Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
- Installation and configuration of PLSQL
- 漏洞複現-Fastjson 反序列化
- The reified keyword in kotlin is used for generics
- Zcmu--1396: queue problem (2)
猜你喜欢

One click deployment of highly available emqx clusters in rainbow

在Rainbond中实现数据库结构自动化升级

JS copy picture to clipboard read clipboard

Application of slip ring of shipborne radar antenna

Learn how to compile basic components of rainbow from the source code

解析创新教育体系中的创客教育
![[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)](/img/c2/32a2c1ede493b778a6c44077d765d0.png)
[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
![[quick start of Digital IC Verification] 13. SystemVerilog interface and program learning](/img/d8/ffc1b7527f0269cecb2946ab402a2e.png)
[quick start of Digital IC Verification] 13. SystemVerilog interface and program learning

Basic use of CTF web shrink template injection nmap

BiSeNet的特点
随机推荐
Golang compilation constraint / conditional compilation (/ / +build < tags>)
The truth of robot education in hands-on practice
解析创新教育体系中的创客教育
In go language, function is a type
CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
解读创客思维与数学课程的实际运用
[quick start of Digital IC Verification] 10. Verilog RTL design must know FIFO
单元测试报告成功率低
Deit learning notes
National standard gb28181 protocol video platform easygbs adds streaming timeout configuration
Snyk 依赖性安全漏洞扫描工具
使用SwinUnet训练自己的数据集
IELTS review progress and method use [daily revision]
漏洞複現-Fastjson 反序列化
Installation and configuration of PLSQL
Kotlin combines flatmap for filtering and zip merge operators
SSM 整合
利用 Helm 在各类 Kubernetes 中安装 Rainbond
藏书馆App基于Rainbond实现云原生DevOps的实践