def main():
while True:
try:
print ('Saving image from camera...')
start_time_camera = time.time()
img = cam.get_image()
pygame.image.save(img, image_path)
end_time_camera =time.time()
time_dif_camera = end_time_camera - start_time_camera
# Print the time-usage.
os.system('cls' if os.name == 'nt' else 'clear')
print ('###### time usage camera ######')
print(str(timedelta(seconds=int(round(time_dif_camera)))))
except (KeyboardInterrupt, SystemExit, RuntimeError, SystemError):
cam.stop()
评论列表
文章目录