Home Article Python time及tqdm使用

Python time及tqdm使用

Release time:2020-07-24 20:33:36 Author:admin Reading volume:81
# time
import time

# for i in range(3):
# time.sleep(2) # 休眠2
# print(i)

print(time.time())
# 1588060269.5188556
# 1970110点(UTC)开始时间

start_time = time.time()

for _ in range(2):
time.sleep(2)
end_time = time.time()

print('total time:', end_time - start_time)
# total time: 4.001206159591675

# tqdm
from tqdm import tqdm # tqdm tqdm
for i in tqdm(range(5)):
time.sleep(2) #进度条显示

 

支付宝打赏 微信打赏
  
I want to comment

Search

Leave a message
http://blog.rjxj513.com/
User login
You have not written any reviews yet!
You have commented!
Can only praise once!
You have a collection!