Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: POE and time

by Ultra (Hermit)
on Nov 07, 2005 at 12:47 UTC ( [id://506315]=note: print w/replies, xml ) Need Help??


in reply to POE and time

My concern is about keeping time accuracy. The project will run 24/24. I have concern that POE may introduce a time lag over time that could result in, say, losing 10 minutes per day or so. Which would be a definite show stopper.

I don't understand your point here... what do you mean by "losing 10 minutes" ??

I can't comment on the differences between Event and POE as I haven't used Event.

But AFAIK you can use Event inside POE. Take a look at: POE::Loop

Dodge This!

Replies are listed 'Best First'.
Re^2: POE and time
by carcassonne (Pilgrim) on Nov 07, 2005 at 13:12 UTC
    I don't understand your point here... what do you mean by "losing 10 minutes" ??

    The PC clock loosing minutes over days, i.e. its clock lagging behind so that in three days instead of 15:00 you'd have 14:20, for instance. Or maybe just 14:57 but still missing accuracy. That's my concern. Events will be logged periodically to a log file and precise time (to the minute at least) is important.

    The machine will not have access to a NTP server.

      And how would you expect a POE program (or any other program in this respect) to know how much time your computer 'loses' ?

      You need a synchronization method, whether a NTP server to sync with, or you know precisely that after X seconds spent, the delay is x seconds and you adjust the time yourself.

      Dodge This!
        And how would you expect a POE program (or any other program in this respect) to know how much time your computer 'loses' ?

        I wouldn't want it to know about lost time. That's not the concern.

        As far as I can see it, it is possible for software to make the system clock loose time. When the PC boots the OS reads the time from the CMOS clock. But from now on, as I see it (tell me if I'm wrong) the CMOS clock is not polled but time is instead kept in the OS and updated using some kind of interrupt scheme. So, this is a (partly ISR) routine that's called regularly.

        Now, a software can somehow prevent the servicable periodicity of that clock-updating routine by very small amounts, and it could accumulate over time, resulting in a system clock that's a bit behind. Of course, next time the PC is rebooted, the time is read from the CMOS clock and everything's fine again. That is, if the CMOS clock was not automatically updated from the system clock at shutdown.

        A spreadsheet software won't do that kind of interference. A game could (look at some Windows games). Or a software that schedules tasks close to the hardware interface.

        Hence, my question about POE on a mostly embedded platform (i.e. no NTP access): has experienced POE developers seen any degradation in system-keeping time when POE was active 24/24 over long periods of time ?

      I'm not sure I understand your question. Running an application using POE (or indeed any other perl module) shouldn't affect the accuracy of your PC's clock. That depends largely on the hardware in the computer (which is generally pretty inaccurate from what I remember).

      If your problem is that you want this application to generate logs with an accurate timestamp, then the ONLY way to do this is to have the PC's clock synchronised with a remote source that is more accurate. NTP is ONE way to do this. You could, of course, invent your own alternative to NTP (Microsoft did this with their "domain time service") - however you're unlikely to get anywhere near the accuracy of NTP by rolling your own (as Microsoft demonstrated).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://506315]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-03-28 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found