import time time_start=time.time() time_end=time.time() print('totally cost',time_end-time_start) 单位是秒