当前位置:网站首页>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")
}
边栏推荐
- 单元测试报告成功率低
- MES系統,是企業生產的必要選擇
- What is the function of paralleling a capacitor on the feedback resistance of the operational amplifier circuit
- Openvscode cloud ide joins rainbow integrated development system
- Improve the delivery efficiency of enterprise products (1) -- one click installation and upgrade of enterprise applications
- Ebpf cilium practice (1) - team based network isolation
- 轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
- Four items that should be included in the management system of integral mall
- Xcit learning notes
- Interpreting the practical application of maker thinking and mathematics curriculum
猜你喜欢

The field value in Splunk subquery fuzzy matching CSV is*

Splunk查询csv lookup table数据动态查询

Through the "last mile" of legal services for the masses, fangzheng Puhua labor and personnel law self-service consulting service platform has been frequently "praised"

解读创客思维与数学课程的实际运用

Interpreting the practical application of maker thinking and mathematics curriculum

使用 Nocalhost 开发 Rainbond 上的微服务应用

拓维信息使用 Rainbond 的云原生落地实践

opencv学习笔记五——梯度计算/边缘检测

Using helm to install rainbow in various kubernetes

Basic use of CTF web shrink template injection nmap
随机推荐
在Rainbond中实现数据库结构自动化升级
【雅思口语】安娜口语学习记录 Part3
DeiT学习笔记
Opencv learning note 5 - gradient calculation / edge detection
One click deployment of highly available emqx clusters in rainbow
Open3d ISS key points
发挥创客教育空间的广泛实用性
The field value in Splunk subquery fuzzy matching CSV is*
Rainbow combines neuvector to practice container safety management
[IELTS speaking] Anna's oral learning records part2
POJ - 3616 Milking Time(DP+LIS)
Low success rate of unit test report
eBPF Cilium实战(1) - 基于团队的网络隔离
PVTV2--Pyramid Vision TransformerV2学习笔记
The reified keyword in kotlin is used for generics
Vulnerability recurrence fastjson deserialization
Opencv learning notes 1 -- several methods of reading images
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
Input of mathematical formula of obsidan
Lua 编程学习笔记