第三十章 方法大全(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
相关推荐
Csvn20 小时前
🌟 LangChain 30 天保姆级教程 · Day 13|OutputParser 进阶!让 AI 输出自动转为结构化对象,并支持自动重试!
python·langchain
cch891820 小时前
Python主流框架全解析
开发语言·python
sg_knight20 小时前
设计模式实战:状态模式(State)
python·ui·设计模式·状态模式·state
好运的阿财21 小时前
process 工具与子agent管理机制详解
网络·人工智能·python·程序人生·ai编程
张張40821 小时前
(域格)环境搭建和编译
c语言·开发语言·python·ai
weixin_4235339921 小时前
【Windows11离线安装anaconda、python、vscode】
开发语言·vscode·python
Ricky111zzz21 小时前
leetcode学python记录1
python·算法·leetcode·职场和发展
小白学大数据21 小时前
Selenium+Python 爬虫:动态加载头条问答爬取
爬虫·python·selenium
Hui Baby1 天前
springboot读取配置文件
后端·python·flask
阿Y加油吧1 天前
回溯法经典难题:N 皇后问题 深度解析 + 二分查找入门(搜索插入位置)
开发语言·python