<div dir="ltr">There is a known problem of windows vs linux with timestamps.<br>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.<br>
<br>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.<br>
<br><br><br><div class="gmail_quote">On Sun, Feb 20, 2011 at 11:47, Bo Berglund <span dir="ltr"><<a href="mailto:bo.berglund@gmail.com">bo.berglund@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
In my data acquisition program I also need to timestamp the retrieved<br>
data from the instrument. I want this to be as accurate as possible<br>
and also portable Windows->Linux->Embedded Linux<br>
<br>
In Delphi/FPC there are two ways to get a time value that I know of:<br>
<br>
GetTickCount gives a value that is in millisecond resolution, but I<br>
don't know how accurate it actually is on the various platforms.<br>
<br>
Now() retrieves a TDateTime value, but again I don't know how accurate<br>
it is. Resolution-wise since it is a double it should suffice since it<br>
is based on the year 1900 and we have about 40500 days since then and<br>
thus about 3.500.000.000 seconds. So the double resolution should get<br>
a bit into the decimals of a second. But how many accurate decimals<br>
can be expected? Can I reach millisecond accuracy?<br>
<br>
If so, which would be the better way?<br>
<br>
<br>
--<br>
Bo Berglund<br>
Developer in Sweden<br>
<font color="#888888"><br>
<br>
--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</font></blockquote></div><br><br>Ido<br clear="all">LINESIP - Opening the source for communication<br><a href="http://www.linesip.com/" target="_blank">http://www.linesip.com</a><br><a href="http://www.linesip.co.il/" target="_blank">http://www.linesip.co.il</a><br>
<br></div>