Time.sleep(0.0125) not available within Linux
Michael Torrie
torriem at gmail.com
Tue Sep 30 19:30:38 EDT 2008
Lawrence D'Oliveiro wrote:
> In message <__KdneWJPotDx0XVnZ2dnUVZ_gGdnZ2d at posted.usinternet>, Grant
> Edwards wrote:
>
>> On 2008-09-23, Blubaugh, David A. <dblubaugh at belcan.com> wrote:
>>
>>> I was wondering if anyone has come across the issue of not being allowed
>>> to have the following within a Python script operating under Linux:
>>>
>>> time.sleep(0.0125)
>> No, I have not. And I doubt anybody else has.
>
> Just a thought, your minimum sleep time is probably limited by the
> resolution of the system "HZ" clock. Type
>
> less /proc/config.gz
>
> and search for the value of the "CONFIG_HZ" setting. On the Athlon 64
> machine I'm using to write this, it's 250, which should allow for sleep
> intervals in multiples of 0.004 seconds.
Since most distributions do not create this file in /proc for whatever
reason, and some people are being deliberately obtuse, does anyone know
how to ask the kernel what the timer resolution is? Is it stored
anywhere else in /proc or /sys? I kind of think most distros set it to
1000 Hz, but I'm not sure.
More information about the Python-list
mailing list