[fpc-pascal] The unfortunate deprecation of GetTickCount

Alexander Grotewohl alex at dcclost.com
Wed Apr 11 19:27:14 CEST 2018


It's deprecated by Microsoft. If I had to guess, it's likely not going 
anywhere until 32bit binary support in Windows is long gone.

Should you use GetTickCount on any Windows system that supports 
(natively) GetTickCount64? NO, not in new code.

That's exactly what deprecated means.

IMO compiling code targeting Windows >= Vista that has GetTickCount in 
it is no good.

Alex


On 04/11/2018 12:57 PM, Luca Olivetti wrote:
> 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




More information about the fpc-pascal mailing list