第三十章 方法大全(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
相关推荐
数新网络2 分钟前
PyTorch
人工智能·pytorch·python
自信的小螺丝钉7 分钟前
【大模型手撕】pytorch实现LayerNorm, RMSNorm
人工智能·pytorch·python·归一化·rmsnorm·layernorm
深耕AI7 分钟前
PyTorch图像预处理:ToTensor()与Normalize()的本质区别
人工智能·pytorch·python
鲸屿1951 小时前
python之socket网络编程
开发语言·网络·python
里昆1 小时前
【AI】Tensorflow在jupyterlab中运行要注意的问题
人工智能·python·tensorflow
AI视觉网奇1 小时前
pycharm 最新版上一次编辑位置
python
2401_828890641 小时前
使用 BERT 实现意图理解和实体识别
人工智能·python·自然语言处理·bert·transformer
多恩Stone2 小时前
【3DV 进阶-2】Hunyuan3D2.1 训练代码详细理解下-数据读取流程
人工智能·python·算法·3d·aigc
xiaopengbc3 小时前
在 Python 中实现观察者模式的具体步骤是什么?
开发语言·python·观察者模式
Python大数据分析@3 小时前
python用selenium怎么规避检测?
开发语言·python·selenium·网络爬虫