problems with Time::HiRes on some SLES systems



I've been using this module for doing highly accurate sleeping. I would essentially set an alarm for n-seconds and then so a sleep for time time greater then n. When the signal is delivered and I act on it (or simply just return), my app simply continues after the sleep.

I'm now trying this on several freshly installed sles10 systems and it wakes up early when the time is 5 or greater and I have no clue why. It runs just fine on every other system/architecture I've tried. Could something be missing from the installation? Is there some easy way to tell??

Here's what the script looks like:

#!/usr/bin/perl -w

use Time::HiRes;

$SIG{ALRM}=\&sigAlrm;

for ($i=1; $i<60; $i++)
{
$time0=time;
Time::HiRes::ualarm($i*1000000);
sleep 100;
printf "Alarm: $i Awake! %d secs\n", time-$time0;
}

# usleep wakeup
sub sigAlrm
{
}

and here's what it's producing on 3 systems:

linux:/mjs # /usr/bin/perl sht.pl
Alarm: 1 Awake! 1 secs
Alarm: 2 Awake! 2 secs
Alarm: 3 Awake! 3 secs
Alarm: 4 Awake! 4 secs
Alarm: 5 Awake! 0 secs
Alarm: 6 Awake! 2 secs
Alarm: 7 Awake! 3 secs
Alarm: 8 Awake! 3 secs
Alarm: 9 Awake! 1 secs
Alarm: 10 Awake! 1 secs
Alarm: 11 Awake! 3 secs
Alarm: 12 Awake! 3 secs
Alarm: 13 Awake! 0 secs
Alarm: 14 Awake! 1 secs
Alarm: 15 Awake! 2 secs

I'm stumped...
-mark
.



Relevant Pages

  • Re: Humorous Happenings While Sleepwalking
    ... (mind or body) ... *ambien* story), go to sleep. ... says that I'm "awake", eyes are open, I can talk to him, and respond ... When the alarm would go off, ...
    (alt.support.chronic-pain)
  • Re: "My alarm is making a noise"
    ... they can not sleep due to an intermittent loud high frequency beep ... allegedly from the alarm system. ... constantly going off and keeping me awake". ...
    (alt.security.alarms)
  • Re: Joke Book
    ... or Robin Williams? ... alarm. ... who prefers to awake to the soothing drone of NPR ...
    (rec.humor)
  • Re: Joke Book
    ... or Robin Williams? ... alarm. ... who prefers to awake to the soothing drone of NPR ...
    (rec.humor)
  • Re: Blessing in disguise
    ... any circumstances wake me up before the alarm clock. ... I have three cats that sleep with me, but when I am having trouble with insomnia or am not sleeping well for some reason, the cats get kicked out. ... I love cuddling with them in the recliner during those times or carrying them around or holding them while I am on the computer, but if sleep problems crop up - out the cats go. ...
    (rec.pets.cats.anecdotes)