[Lazarus] Portable way to get accurate timestamps?

Marco van de Voort marcov at stack.nl
Sun Feb 27 21:42:27 CET 2011


On Sun, Feb 27, 2011 at 06:51:21PM +0200, Graeme Geldenhuys wrote:

> The current linux version of GetTickCount is
> very rudimentary.

Possibly. But IMHO it is a windows knock-off function, and is defined as it
is defined to keep code more or less running. If it drags in heaps of
requirements, its portability status will have to be reviewed IMHO

> As a few Google searches will show, many other
> developers are saying that using clock_gettime() under linux gives you
> the equivalent timing as the multimedia API under Windows.

Then make a nice linux specific unit, and post it on some website. 

> So couldn't the GetTickCount for linux use the improved function
> calls?

I don't see the use of that. It will only complicate documentation to change
behaviour across platforms even more.

> I'm not talking about all other unix functions, start with
> maybe only Linux and work from there.

No. That is not the way we do the Unix rtl. If we had done that, and caved
at each challenge, we would be back at the unit libc chaos by now.

unit libc by now




More information about the Lazarus mailing list