Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-12 Thread R0b0t1
On Thu, Apr 12, 2018 at 1:10 AM, Graeme Geldenhuys wrote: > On 2018-04-11 17:44, R0b0t1 wrote: >> This is related to something I meant to propose a while ago related to >> a cross platform timing and alarm API. > > That already exists in the form of EpikTimer >

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-12 Thread Graeme Geldenhuys
On 2018-04-12 07:39, Michael Van Canneyt wrote: > Ah, finally ! > I was waiting for epiktimer to pop up in the discussion... > > Thank you, Graeme :-) Not sure if that was meant as sarcastic or not. I mentioned EpikTimer, because it rolls most use cases into one easy to use class. Plus EpikTimer

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-12 Thread Michael Van Canneyt
On Thu, 12 Apr 2018, Graeme Geldenhuys wrote: On 2018-04-11 17:44, R0b0t1 wrote: This is related to something I meant to propose a while ago related to a cross platform timing and alarm API. That already exists in the form of EpikTimer (https://github.com/graemeg/epiktimer). That is the

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-12 Thread Graeme Geldenhuys
On 2018-04-11 17:44, R0b0t1 wrote: > This is related to something I meant to propose a while ago related to > a cross platform timing and alarm API. That already exists in the form of EpikTimer (https://github.com/graemeg/epiktimer). That is the latest implementation with the permission of the

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Karoly Balogh (Charlie/SGR)
Hi, On Wed, 11 Apr 2018, Alexander Grotewohl wrote: > Just to be clear, the 64 in GetTickCount64 has nothing to do with > whether a machine is 32bit or 64bit. The call itself, doesn't. Except, on a 32bit machine, when you have to do 64bit arithmetic/value handling, it's usually less

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Luca Olivetti
El 11/04/18 a les 19:27, Alexander Grotewohl ha escrit: It's deprecated by Microsoft. It doesn't say anything about deprecation here https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx Bye -- Luca ___ fpc-pascal maillist

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Alexander Grotewohl
Just to be clear, the 64 in GetTickCount64 has nothing to do with whether a machine is 32bit or 64bit. Alex On 04/11/2018 01:23 PM, Karoly Balogh (Charlie/SGR) wrote: Hi, On Wed, 11 Apr 2018, Michael Van Canneyt wrote: personally I use this 64 bit emulation: For my purpose I'm perfectly

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread R0b0t1
On Wed, Apr 11, 2018 at 12:11 PM, Tomas Hajny wrote: > On Wed, April 11, 2018 18:44, R0b0t1 wrote: > > . > . >> This is related to something I meant to propose a while >> ago related to a cross platform timing and alarm API. >> I do not think GetTickCount should ever be used;

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Alexander Grotewohl
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

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Karoly Balogh (Charlie/SGR)
Hi, On Wed, 11 Apr 2018, Michael Van Canneyt wrote: > >> 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

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Tomas Hajny
On Wed, April 11, 2018 18:44, R0b0t1 wrote: . . > This is related to something I meant to propose a while > ago related to a cross platform timing and alarm API. > I do not think GetTickCount should ever be used; > instead, QueryPerformanceCounter makes more sense. It is > higher resolution and

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Luca Olivetti
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

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread R0b0t1
On Wed, Apr 11, 2018 at 11:26 AM, Alexander Grotewohl wrote: > The documentation seems fine. I can use it to approximate that a minute has > elapsed, or to keep track of frames per second for a game, but I'm not going > to use it to control complex machinery. > > The

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Michael Van Canneyt
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.

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Alexander Grotewohl
The documentation seems fine. I can use it to approximate that a minute has elapsed, or to keep track of frames per second for a game, but I'm not going to use it to control complex machinery. The GetTickCount documentation offers that most system timers are within the 10 to 16 millisecond

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Luca Olivetti
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. Bye -- Luca

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Luca Olivetti
El 11/04/18 a les 15:40, Paulo Costa ha escrit: Unfortunate is the obscure wording you find on the documentation: https://www.freepascal.org/docs-html/rtl/sysutils/gettickcount.html Yes, you're right, but that's another issue. When the documentation is vague and I need details I look at the

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Paulo Costa
Unfortunate is the obscure wording you find on the documentation: https://www.freepascal.org/docs-html/rtl/sysutils/gettickcount.html "Description GetTickCount returns an increasing clock tick count. It is useful for time measurements, but no assumtions should be made as to the interval

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Tobias Giesen
Hello, personally I use this 64 bit emulation: var CurrentIncrement:Int64=0; LastTickCount:Int64=0; function TGGetTickCount64:Int64; begin {$ifdef CPUX64} Result:=GetTickCount64; {$else} Result:=GetTickCount+CurrentIncrement; if Result wrote: > El 11/04/18 a les 10:06, Luca

Re: [fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Luca Olivetti
El 11/04/18 a les 10:06, Luca Olivetti ha escrit: BEFORE (with gettickcount): -- var PreviousTick:DWORD; ...   PreviousTick:=GetTickCount; ... ... if DWORD(GetTickCount-PreviousTick)>WaitTime then BTW, the DWORD

[fpc-pascal] The unfortunate deprecation of GetTickCount

2018-04-11 Thread Luca Olivetti
GetTickCount has been deprecated in favor of GetTickCount64, which gives a qword result and so it "solves" the wrap-arount to 0 of the tick after 49.7 days, so one doesn't have to worry that the expression GetTickCount64-PreviousTick will ever give a negative result, and if