当前位置:网站首页>实例009:暂停一秒输出
实例009:暂停一秒输出
2022-07-05 08:16:00 【懒笑翻】
题目内容
#### 实例009:暂停一秒输出 # **题目:**暂停一秒输出。
问题分析
**使用 time 模块的 sleep() 函数实现暂停。
程序
import time
while True:
# print(time.asctime())
print(time.strftime('%Y-%m-%d %H:%M:%S'))
time.sleep(1)
输出结果
2022-07-04 22:06:08
2022-07-04 22:06:09
2022-07-04 22:06:10
2022-07-04 22:06:11
2022-07-04 22:06:12
2022-07-04 22:06:13
2022-07-04 22:06:14
2022-07-04 22:06:15
2022-07-04 22:06:16
2022-07-04 22:06:17
2022-07-04 22:06:18
2022-07-04 22:06:19
2022-07-04 22:06:20
······
······
······
边栏推荐
- Shape template matching based on Halcon learning [viii] PM_ multiple_ models. Hdev routine
- Shell脚本基本语法
- Hardware 1 -- relationship between gain and magnification
- Halcon's practice based on shape template matching [1]
- Soem EtherCAT source code analysis attachment 1 (establishment of communication operation environment)
- Development tools -- gcc compiler usage
- STM32 --- configuration of external interrupt
- Problem solving: interpreter error: no file or directory
- MySQL之MHA高可用集群
- STM32 single chip microcomputer - bit band operation
猜你喜欢
Volatile of C language
UEFI development learning 6 - creation of protocol
Keil use details -- magic wand
Consul installation
[tutorial 19 of trio basic from introduction to proficiency] detailed introduction of trio as a slave station connecting to the third-party bus (anybus PROFIBUS DP...)
Negative pressure generation of buck-boost circuit
C WinForm [change the position of the form after running] - Practical Exercise 4
Explain task scheduling based on Cortex-M3 in detail (Part 2)
Detailed summary of FIO test hard disk performance parameters and examples (with source code)
STM32 virtualization environment of QEMU
随机推荐
Semiconductor devices (I) PN junction
STM32---IIC
Soem EtherCAT source code analysis attachment 1 (establishment of communication operation environment)
Detailed explanation of SQL server stored procedures
C WinForm [change the position of the form after running] - Practical Exercise 4
List of linked lists
【云原生 | 从零开始学Kubernetes】三、Kubernetes集群管理工具kubectl
[tutorial 15 of trio basic from introduction to proficiency] trio free serial communication
Installation and use of libjpeg and ligpng
Sizeof (function name) =?
Management and use of DokuWiki
[paper reading] the latest transfer ability in deep learning: a survey in 2022
STM32 outputs 1PPS with adjustable phase
C WinForm [realize the previous and next selection pictures] - practice 7
Shell script basic syntax
Measurement fitting based on Halcon learning [III] PM_ measure_ board. Hdev routine
Several implementation schemes of anti reverse connection protection of positive and negative poles of power supply!
C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
Some tips for using source insight (solve the problem of selecting all)
Weidongshan Internet of things learning lesson 1