当前位置:网站首页>实例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
······
······
······
边栏推荐
- Basic embedded concepts
- Anonymous structure in C language
- Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
- C WinForm [display real-time time in the status bar] - practical exercise 1
- Soem EtherCAT source code analysis II (list of known configuration information)
- Live555 push RTSP audio and video stream summary (I) cross compilation
- MySQL MHA high availability cluster
- More than 90% of hardware engineers will encounter problems when MOS tubes are burned out!
- Factors affecting the quality of slip rings in production
- go依赖注入--google开源库wire
猜你喜欢
Simple design description of MIC circuit of ECM mobile phone
1-stm32 operation environment construction
List of linked lists
Tailq of linked list
[trio basic tutorial 16 from introduction to proficiency] UDP communication test supplement
Semiconductor devices (I) PN junction
Classic application of MOS transistor circuit design (2) - switch circuit design
Various types of questions judged by prime numbers within 100 (C language)
Classic application of MOS transistor circuit design (1) -iic bidirectional level shift
Working principle and type selection of common mode inductor
随机推荐
MySQL MHA high availability cluster
STM32 outputs 1PPS with adjustable phase
STM32 tutorial triple ADC interleaved sampling
Management and use of DokuWiki
Negative pressure generation of buck-boost circuit
Google sitemap files for rails Projects - Google sitemap files for rails projects
Summary -st2.0 Hall angle estimation
[tutorial 15 of trio basic from introduction to proficiency] trio free serial communication
C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
Shape template matching based on Halcon learning [viii] PM_ multiple_ models. Hdev routine
Solutions to compilation warnings in Quartus II
Connection mode - bridge and net
C # joint configuration with Halcon
Explain task scheduling based on Cortex-M3 in detail (Part 1)
Network communication process
Factors affecting the quality of slip rings in production
Basic embedded concepts
C language enhancement -- pointer
C WinForm [get file path -- traverse folder pictures] - practical exercise 6
Drive LED -- GPIO control