[fpc-pascal] The unfortunate deprecation of GetTickCount

Luca Olivetti luca at ventoso.org
Wed Apr 11 18:57:56 CEST 2018


El 11/04/18 a les 18:42, Michael Van Canneyt ha escrit:
> 
> 
> On Wed, 11 Apr 2018, Luca Olivetti wrote:
> 
>> El 11/04/18 a les 13:59, Tobias Giesen ha escrit:
>>> Hello,
>>>
>>> personally I use this 64 bit emulation:
>>
>> For my purpose I'm perfectly happy with GetTickCount. I'd understand 
>> the deprecation if GetTickCount64 would be a reliable substitute. It 
>> isn't.
> 
> Only on XP. On all other platforms, it is the better solution.

It depends. If you just want to keep track of intervals less than 49 
days, GetTickCount is perfectly good (provided you cast the difference 
between the current tick and the previous one to dword) *and* it works 
on XP (which, unfortunately, I still have to support).
I see no reason to deprecate it.

BTW, advancedipc.pp uses

   until (GetTickCount64-xStart > aTimeOut);

so it could hang if used in windows XP.


Bye
-- 
Luca


More information about the fpc-pascal mailing list