第三十章 方法大全(Python)

文章目录


一、日期

1、time模块

python 复制代码
import time
方法 描述
time.sleep(secs) 程序暂停执行指定的秒数
python 复制代码
'''
time.sleep(secs)
	参数:
		secs:推迟执行的秒数
		
	Delay execution for a given number of seconds.  The argument may be
    a floating point number for subsecond precision.
'''
time.sleep(1)
方法 描述
time.time() 返回当前系统时间的时间戳(从1970年1月1日午夜(UTC/GMT)到当前时间的秒数,是一个浮点数,包括秒数和小数部分,小数部分表示更精确的时间。)
python 复制代码
'''
time.time()
	无参数
	
	Delay execution for a given number of seconds.  The argument may be
    a floating point number for subsecond precision.
'''
start = time.time()
print(start)  # 1720171791.0012453
相关推荐
BO_S__几秒前
python调用ffmpeg对截取视频片段,可批量处理
python·ffmpeg·音视频
就叫飞六吧27 分钟前
如何判断你的PyTorch是GPU版还是CPU版?
人工智能·pytorch·python
pyengine2 小时前
基于pandoc的MarkDown格式与word相互转换小工具开发(pyqt5)
开发语言·python·qt·word
YuSun_WK2 小时前
配置MambaIRv2: Attentive State Space Restoration的环境
开发语言·python
Nick_zcy2 小时前
开发基于python的商品推荐系统,前端框架和后端框架的选择比较
开发语言·python·前端框架·flask·fastapi
一点.点3 小时前
李沐动手深度学习(pycharm中运行笔记)——04.数据操作
pytorch·笔记·python·深度学习·pycharm·动手深度学习
Niuguangshuo3 小时前
Python 设计模式:访问者模式
python·设计模式·访问者模式
Jamesvalley3 小时前
【Django】新增字段后兼容旧接口 This field is required
后端·python·django
Luck_ff08103 小时前
【Python爬虫详解】第四篇:使用解析库提取网页数据——BeautifuSoup
开发语言·爬虫·python
学渣676564 小时前
什么时候使用Python 虚拟环境(venv)而不用conda
开发语言·python·conda