Time.sleep(0.0125) not available within Linux

B

Blubaugh, David A.

To All,


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)

It appears that I am not allowed to have the object sleep. Has anyone
encountered this specific issue before in the past?


Thank You,


David Blubaugh







This e-mail transmission contains information that is confidential and may be
privileged. It is intended only for the addressee(s) named above. If you receive
this e-mail in error, please do not read, copy or disseminate it in any manner.
If you are not the intended recipient, any disclosure, copying, distribution or
use of the contents of this information is prohibited. Please reply to the
message immediately by informing the sender that the message was misdirected.
After replying, please erase it from your computer system. Your assistance in
correcting this error is appreciated.
 
L

Lawrence D'Oliveiro

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.
 
S

Steven D'Aprano

Just a thought, your minimum sleep time is probably limited by the
resolution of the system "HZ" clock. Type

less /proc/config.gz


$ less /proc/config.gz
/proc/config.gz: No such file or directory


What OS are you using?
 
L

Lawrence D'Oliveiro

Steven D'Aprano said:
$ less /proc/config.gz
/proc/config.gz: No such file or directory


What OS are you using?

The one named in the subject line?
 
S

Steven D'Aprano

The one named in the subject line?

Are you asking me or telling me?


I've tried on five different Linux machines I have access to, and there
is no such /proc/config.gz on any of them:

two different versions of Centos
two versions of Fedora
one version of Ubuntu

So let me rephrase my question... what *specific* OS are you using?
 
J

jkn

Are you asking me or telling me?

I've tried on five different Linux machines I have access to, and there
is no such /proc/config.gz on any of them:

/proc/config.gz is not directly connected with a specific linux
distribution; it's a function of the kernel build configuration. If
the appropriate setting is enabled, then /proc/config.gz will show
(via eg. zcat) the equivalent of the .config file used to build the
kernel you are actually running. It's a useful feature in all linuces,
going back quite a way IIRC.

J^n
 
L

Lawrence D'Oliveiro

Because it might not be. It depends on the user's newsreader
and editor settings.

So, should I not assume that they can see the content as well, because it
might not be visible, depending on the user's newsreader and editor
settings?
 
G

Gabriel Genellina

En Sat, 27 Sep 2008 01:46:45 -0300, Lawrence D'Oliveiro
So, should I not assume that they can see the content as well, because it
might not be visible, depending on the user's newsreader and editor
settings?

Of course not. But the space allowed for the subject line may be limited -
body usually wraps, but subject might not. Add a few Re: Rv: at the start
and even fewer characters are displayed.
I currently see the subject line shortened at: available wi...
 
M

Michael Torrie

Lawrence said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top