当前位置:网站首页>实例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
······
······
······
边栏推荐
- Process communication mode between different hosts -- socket
- Hardware 3 -- function of voltage follower
- Sql Server的存储过程详解
- 亿学学堂给的证券账户安不安全?哪里可以开户
- STM32 single chip microcomputer -- debug in keil5 cannot enter the main function
- Explain task scheduling based on Cortex-M3 in detail (Part 1)
- STM32 --- configuration of external interrupt
- 99 multiplication table (C language)
- Simple design description of MIC circuit of ECM mobile phone
- [trio basic from introduction to mastery tutorial XIV] trio realizes unit axis multi-color code capture
猜你喜欢
Programming knowledge -- basis of C language
Shell script basic syntax
Consul installation
Take you to understand the working principle of lithium battery protection board
UEFI development learning 6 - creation of protocol
Nb-iot technical summary
Count the number of inputs (C language)
Talk about the function of magnetic beads in circuits
STM32 single chip microcomputer - bit band operation
Basic embedded concepts
随机推荐
Installation and use of libjpeg and ligpng
Sql Server的存储过程详解
OC and OD gate circuit
QEMU demo makefile analysis
STM32 --- GPIO configuration & GPIO related library functions
Hardware 3 -- function of voltage follower
Array integration initialization (C language)
Zero length array in GNU C
Live555 push RTSP audio and video stream summary (III) flower screen problem caused by pushing H264 real-time stream
[trio basic tutorial 16 from introduction to proficiency] UDP communication test supplement
VESC Benjamin test motor parameters
Gradle composite construction
OLED 0.96 inch test
Classic application of MOS transistor circuit design (2) - switch circuit design
Consul安装
Detailed explanation of SQL server stored procedures
Management and use of DokuWiki
Summary -st2.0 Hall angle estimation
Brief discussion on Buck buck circuit
Correlation based template matching based on Halcon learning [II] find_ ncc_ model_ defocused_ precision. hdev