当前位置:网站首页>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")
}
边栏推荐
- [quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
- 雅思考试自己的复习进度以及方法使用【日更版】
- Rainbow 5.7.1 supports docking with multiple public clouds and clusters for abnormal alarms
- Deit learning notes
- Interpreting the practical application of maker thinking and mathematics curriculum
- grpc、oauth2、openssl、双向认证、单向认证等专栏文章目录
- 一种适用于应用频繁测试下快速查看Pod的日志的方法(grep awk xargs kuberctl)
- Vulnerability recurrence easy_ tornado
- 归并排序和非比较排序
- 打通法律服务群众“最后一公里”,方正璞华劳动人事法律自助咨询服务平台频获“点赞”
猜你喜欢

The field value in Splunk subquery fuzzy matching CSV is*

Wang Zijian: is the NFT of Tencent magic core worth buying?

机器人教育在动手实践中的真理

SSM integration

BiSeNet的特点

CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand

Openvscode cloud ide joins rainbow integrated development system

eBPF Cilium实战(1) - 基于团队的网络隔离

The truth of robot education in hands-on practice

Opencv learning notes II - basic image operations
随机推荐
Ebpf cilium practice (1) - team based network isolation
MES系統,是企業生產的必要選擇
POJ - 3784 Running Median(对顶堆)
opencv学习笔记三——图像平滑/去噪处理
BiSeNet的特点
接口作为参数(接口回调)
OpenVSCode云端IDE加入Rainbond一体化开发体系
Deit learning notes
GFS distributed file system
Pvtv2--pyramid vision transformer V2 learning notes
Application of slip ring of shipborne radar antenna
Automatic upgrading of database structure in rainbow
Domain specific language / DSL in kotlin
如何理解分布式架构和微服务架构呢
归并排序和非比较排序
Improve the delivery efficiency of enterprise products (1) -- one click installation and upgrade of enterprise applications
【雅思口语】安娜口语学习记录 Part2
XCiT学习笔记
Using nocalhost to develop microservice application on rainbow
Splunk query CSV lookup table data dynamic query