[Lazarus] Portable way to get accurate timestamps?

Bo Berglund bo.berglund at gmail.com
Sun Feb 20 12:42:05 CET 2011


On Sun, 20 Feb 2011 11:58:59 +0200, ik <idokan at gmail.com> wrote:

>There is a known problem of windows vs linux with timestamps.
>Windows for some reason is less accurate and change the clock every usage of
>Windows, while in Linux it's considered more accurate. I'm saying it from a
>bad experience so far.
>
>Secondly. you always have to know where the clock is set for. that is
>timezone etc... If it's UTC or timezone changes the way you should use the
>timestamp then a local one, unless you are interested in the local time
>only.
>

In fact I am interested mainly in the time *difference* between
successive measured data points. So if I could get a fix at the first
measure to a complete time stamp, then all following need only a
fairly accurate *relative* time from the first.

I wonder if GetTickCount will get me a better value to milliseconds
than Now()?

I have heard of a "multimedia" time on Windows, which is more
accurate, but I am not sure how to use it and if it exists on Linux...


-- 
Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list