Python time.sleep()的上限? [英] Upper limit in Python time.sleep()?

查看:1270
本文介绍了Python time.sleep()的上限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以指定一个线程以time.sleep()进入睡眠状态的上限吗?我长期处于休眠状态(即超过1k秒)时一直遇到问题. Windows和Unix平台上均已出现此问题.

Is there an upper limit to how long you can specify a thread to sleep with time.sleep()? I have been having issues with sleeping my script for long periods (i.e., over 1k seconds). This issue has appeared on both Windows and Unix platforms.

推荐答案

我认为时间越长,

实际的暂停时间可能少于请求的暂停时间,因为任何捕获到的信号都会在执行该信号的捕获例程后终止sleep().另外,由于系统中其他活动的安排,暂停时间可能比请求的时间长任意数量.

The actual suspension time may be less than that requested because any caught signal will terminate the sleep() following execution of that signal’s catching routine. Also, the suspension time may be longer than requested by an arbitrary amount because of the scheduling of other activity in the system.

这篇关于Python time.sleep()的上限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆