time.sleep(1) sometimes runs for 200 seconds under windows

P

Paul Probert

Hi,
My app runs in a loop looking for changes in a database, and like a
good boy I call time.sleep(1) inside the loop. Unfortunately this
sometimes runs for 200 seconds or so, presumably while my OS is calling
Bill Gates to tell him what I've been doing. This happens under NT4,
W2k, and XP. What do people do to fix this? Thanks!

Paul Probert
University of Wisconsin
 
C

Claudio Grondi

Paul said:
Hi,
My app runs in a loop looking for changes in a database, and like a
good boy I call time.sleep(1) inside the loop. Unfortunately this
sometimes runs for 200 seconds or so, presumably while my OS is calling
Bill Gates to tell him what I've been doing. This happens under NT4,
W2k, and XP. What do people do to fix this? Thanks!

Paul Probert
University of Wisconsin

In similar situation I would start to blame the hardware for the
problem, so below a kind of checklist to go through:

1. have you changed any hardware?
2. have you installed new drivers?
3. have you connected via USB/Firewire/IDE or other interfaces/ports
etc. some new devices?
4. have you installed new BIOS?
5. is your RAM ok?
6. are you sure there is no CD/DVD in your CD/DVD drive?
7. are you sure there is no floppy disk in your floppy drive?
8. are you sure your CPU/motherboard/RAM is not overheating?

Claudio
 
P

Paul Probert

Claudio said:
In similar situation I would start to blame the hardware for the
problem, so below a kind of checklist to go through:

1. have you changed any hardware?
2. have you installed new drivers?
3. have you connected via USB/Firewire/IDE or other interfaces/ports
etc. some new devices?
4. have you installed new BIOS?
5. is your RAM ok?
6. are you sure there is no CD/DVD in your CD/DVD drive?
7. are you sure there is no floppy disk in your floppy drive?
8. are you sure your CPU/motherboard/RAM is not overheating?

Claudio
Claudio,
Thanks for the reply. I should have mentioned, this happens to just
about every machine in our collection of about 20 machines. Each is of a
different age, and the hardware is completely diverse. Each has either
of NT4, win2k, or XP installed. They all belong to our domain

Paul Probert
University of Wisconsin
 
G

Grant Edwards

Thanks for the reply. I should have mentioned, this happens to just
about every machine in our collection of about 20 machines. Each is of a
different age, and the hardware is completely diverse. Each has either
of NT4, win2k, or XP installed. They all belong to our domain

Time to dowload a linux CD then, eh?
 
D

Dennis Lee Bieber

Thanks for the reply. I should have mentioned, this happens to just
about every machine in our collection of about 20 machines. Each is of a
different age, and the hardware is completely diverse. Each has either
of NT4, win2k, or XP installed. They all belong to our domain
Any chance they all tend to have slow clocks, and are getting bitten
by a semi-random NTP time update; my machine tends to run the NTP update
at 7-day intervals (including time of day), counting from the last
successful synchronization.
--
 
P

Paul Rubin

Dennis Lee Bieber said:
Any chance they all tend to have slow clocks, and are getting bitten
by a semi-random NTP time update; my machine tends to run the NTP update
at 7-day intervals (including time of day), counting from the last
successful synchronization.

This is a good possibility, that the clock is jumping ahead rather
than that 200 seconds of actual real time is going during the
time.sleep call.

What happens if you replace the time.time call with something that
reads the current time from an SNTP server (or equivalent) through a
socket?
 
P

Paul Probert

Grant said:
Time to dowload a linux CD then, eh?
We are looking at that very seriously. The big hurdle is that we run a
lot of laboratory hardware that has no support under linux. A world
where there is no more Kazaa or sasser seems like it would be wonderful,
though.

Paul Probert
University of Wisconsin
 
P

Paul Probert

Dennis said:
Any chance they all tend to have slow clocks, and are getting bitten
by a semi-random NTP time update; my machine tends to run the NTP update
at 7-day intervals (including time of day), counting from the last
successful synchronization.
This is now our leading suspect. All the affected machines have
"abouttime.exe" running as a service, something our sysadmin put in a
few years ago. We are currently disabling this and now waiting for the
proof.
Thanks!

Paul Probert
University of Wisconsin
 
D

Dennis Lee Bieber

This is now our leading suspect. All the affected machines have
"abouttime.exe" running as a service, something our sysadmin put in a
few years ago. We are currently disabling this and now waiting for the
proof.

Hmmm, I wonder how compatible that is with WinXP -- since XP already
has an internet time synch built into the date/time preferences page
(need admin privs to view).

Pre-XP may not have had such...
--
 
R

Roel Schroeven

Dennis Lee Bieber schreef:
Hmmm, I wonder how compatible that is with WinXP -- since XP already
has an internet time synch built into the date/time preferences page
(need admin privs to view).

It's easily disabled. I disable it and use NTP for Windows instead on
machines I control since it works much better.
Pre-XP may not have had such...

Windows 2000 had it too, but there was no GUI to configure it; you had
to manually edit the registry.
 

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,774
Messages
2,569,596
Members
45,130
Latest member
MitchellTe
Top