import time
start_time = time.time()
......
print('Total processing time: {} seconds'.format(round(time.time() - start_time, 2)))
输出:Total processing data time: 132.31 seconds
或
start_time = time.time()
......
end_time = time.time()
print('Total processing time:',end_time - start_time)