[Lazarus] How to program with time in milliseconds?

Henry Vermaak henry.vermaak at gmail.com
Mon May 12 22:37:20 CEST 2014


On Mon, May 12, 2014 at 08:12:45PM +0200, Sven Barth wrote:
> On 12.05.2014 15:33, Michael Schnell wrote:
> >On 05/12/2014 02:47 PM, Reinier Olislagers wrote:
> >>Do you mean direct access to the hardware bypassing the OS? I
> >>thought that wasn't possible in Windows?
> >
> >I don't know how the dynamic library call in Windows works.
> 
> If in doubt, take a look at ReactOS ;)
> 
> QueryPerformanceCounter calls NtQueryPerformanceCounter (which is a
> system call), which in turn calls KeQueryPerformanceCounter (which is
> implemented by the Hardware Abstraction Layer) which is defined here
> at around line 250:
> http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/timer.c?revision=58489&view=markup

On linux, glibc (and others) will route gettimeofday() (and
clock_gettime() for certain clock IDs) via vDSO and no syscall will be
called, so it's very fast.  I don't think the fpc rtl does this, though?

More info in the vdso man page for which functions are supported for
which architectures.

Henry




More information about the Lazarus mailing list