[fpc-pascal] Very vague gettickcount64 description?

Luca Olivetti luca at ventoso.org
Sat Sep 7 21:01:27 CEST 2019


El 7/9/19 a les 13:38, Michael Van Canneyt ha escrit:
> 
> 
> On Sat, 7 Sep 2019, Marco van de Voort wrote:
> 
>>
>> Op 2019-09-06 om 20:02 schreef Michael Van Canneyt:
>>
>>
>>>
>>> What I will do is explain in the documentation why the units are not
>>> mentioned.
>>>
>> Can we remove the division in *nix also ? If ms resolution is not 
>> supported, then why divide the us/ns ? It serves no purpose, if 
>> rollover and unit size are not guaranteed.
> 
> I think it should be removed.

GetTickCount is a windosism.
It should give the result in ms or not be provided at all.

https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-gettickcount

If you want more resolution/precision use something else (if available).
For what I do GetTickCount is perfectly fine (as long as it gives the 
result in ms and it has a resolution around 10ms).
What is a travesty is the "emulation" of GetTickCount64 with 
GetTickCount for the windows versions where GetTickCount64 isn't 
available. *That* will produce problems with the unexpected rollover to 
0 after 49 days.
It doesn't help that GetTickCount has been marked as deprecated (and 
there the rollover isn't a problem because it is expected and you know 
you cannot time events longer than 49 days).

Bye
-- 
Luca


More information about the fpc-pascal mailing list