[Lazarus] How to program with time in milliseconds?

Michael Schnell mschnell at lumino.de
Tue May 13 09:51:39 CEST 2014


On 05/12/2014 10:37 PM, Henry Vermaak wrote:
> 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? 

I checked with X86 32 Bit Linux: you are right.

e.g. http://x86.renejeschke.de/html/file_module_x86_id_277.html

talks about the ASM instruction "RDPMC":

> When in protected or virtual 8086 mode, the performance-monitoring 
> counters enabled (PCE) flag in register CR4 restricts the use of the 
> RDPMC instruction as follows. When the PCE flag is set, the RDPMC 
> instruction can be executed at any privilege level; when the flag is 
> clear, the instruction can only be executed at privilege level 0.

Hence, I don't know if accessing the " performance-monitoring counter" 
this is possible / viable in the fpc RTL.

-Michael





More information about the Lazarus mailing list