Re: after ids



Kevin Kenny wrote:
Many people here are unquestionably arguing from ignorance, but I do
suspect after some conversations with Alexandre Ferrieux that they
are onto something with wanting a distinction between absolute and
relative times.

While I could always see how to do it with single sets of timers, I
could never work out how to do it reliably with multiple event
sequences on different scales (e.g. a 13ms interval and a 1s interval)
where the event processing takes an appreciable time w.r.t. the
shorter intervals. Which happens for sure when using, say, Tk; redraws
are quite expensive. With each pending timer event assigned an
absolute time at which it becomes eligible for execution, it's pretty
simple to handle. But without it...

I - and apparently you, Donal - had long believed that no portable
way existed to get such a clock, but I am coming to suspect that the
world is catching up with our needs. On Windows, the information is
available with the GetTickCount function, which has existed since the
beginning (Windows attempts to calibrate its rate to NTP corrections,
but guarantees its monotonicity except for the 49.7-day rollover,
which we could deal with easily). Unix-like systems are a tougher
nut to crack, but with the Posix standards being implemented more and
more widely, I suspect that the times() function is a reasonable
reference on Unix-like systems.

Alas, no. On Darwin[*], times() is documented as returning the number
of clock ticks since the Unix epoch, and so is inherently coupled to
absolute time. It's also deprecated in favour of gettimeofday() (and
getrusage(), but that's by the by).

Without a monotonic reference, the problem's just about impossible
without doing something elaborate with a RTOS.

Donal.
[* I read this in the manual pages on Leopard... ]
.



Relevant Pages

  • Re: after ids
    ... absolute time at which it becomes eligible for execution, ... way existed to get such a clock, but I am coming to suspect that the ... beginning (Windows attempts to calibrate its rate to NTP corrections, ... Does Darwin have problems with after when daylight savings occurs? ...
    (comp.lang.tcl)
  • Re: Landlord/Landladies and who they can ban
    ... Absolute means Absolute. ... You can "FFS" all you like. ... I suspect you don't. ... Have you always been this stupid or have you worked at it for all of your ...
    (uk.legal)
  • Re: Theories of lead and follow
    ... <I suspect the request was ignored because the absolute answer is ... unimportant - what is important, was explained to be important, and has ...
    (rec.arts.dance)
  • Re: Startup problem
    ... MS-MVP Windows Shell/User ... Absolute hunted and pecked: ... > If you suspect there's a dodgy item in your System Startup how do you get ...
    (microsoft.public.windowsxp.general)