[Lazarus] Portable way to get accurate timestamps?

Graeme Geldenhuys graemeg.lists at gmail.com
Sun Feb 27 17:51:21 CET 2011


On 26 February 2011 20:43, Marco van de Voort <marcov at stack.nl> wrote:
>
> (1) this discussion is about a gettickcount implementation, but I'm not
> entirely sure why this is needed so badly.

I am by no means a libc expert, though I have tried myself to find a
more fine-grained timing call under Linux. Windows (and I believe the
GetTickCount implementation for Windows) uses the higher precision
timing calls from the multimedia API. I can't confirmed this because
I'm not at a computer with FPC source code - but from memory I think
that is how it was done. The current linux version of GetTickCount is
very rudimentary. 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.

So couldn't the GetTickCount for linux use the improved function
calls? I'm not talking about all other unix functions, start with
maybe only Linux and work from there.



-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net




More information about the Lazarus mailing list