in reply to Reasonably accurate timing

What I don't understand is why such accurate timing is required. Is you sample data only valid every 60 seconds exactly? If so, then you need to be cafeful about the thing executing every 60 seconds. If not, then 60.5 is not so bad. Time is arbitrary. Some guy a long time ago said "Well, I think a second should be this long", and it has stuck. We've standardized it since then, but it's still arbitrary. Just something to think about...

Replies are listed 'Best First'.
Re: Re: Reasonably accurate timing
by lhoward (Vicar) on Jul 24, 2001 at 16:37 UTC
    IMHO, being half a second off doesn't matter in this situation (measuring "system data"). But if the situation were different (scientific data) a fraction of a second could be very important.

    In this situation the main thing that needs to be avoided is drift. If you want 60 second intervals, but you have 60.5 second intervals, those 0.5 seconds will add up and you will creep away from where you want to be. In an hour, it'll be off by 30 seconds, etc... What you need is some way of compensating (see all the good solutions above) so that the 0.5 second error doesn't accumulate.