A_TickCount to use GetTickCount64 instead of GetTickCount

Propose new features and changes
User avatar
jNizM
Posts: 2681
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: A_TickCount to use GetTickCount64 instead of GetTickCoun

10 Dec 2014, 09:48

[AHK] 1.1.33.02 x64 Unicode | [WIN] 10 Pro (Version 20H2) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
nnnik
Posts: 4480
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: A_TickCount to use GetTickCount64 instead of GetTickCoun

10 Dec 2014, 09:57

Oh sorry I should have clarified that a bit more:
dont forget the right end-type in ahk

Tick := ((A_Is64bitOS) ? DllCall("Kernel32.dll\GetTickCount64", "UInt64") : DllCall("Kernel32.dll\GetTickCount", "UInt"))
1st example

Code: Select all

var1 := A_TickCount
var2 := DllCall("kernel32.dll\GetTickCount", "UInt")
var3 := DllCall("kernel32.dll\GetTickCount64", "UInt64")
var4 := DllCall("winmm.dll\timeGetTime", "UInt")

MsgBox, % var1 "`n" var2 "`n" var3 "`n" var4 "`n"
2nd example

Code: Select all

Tick := ((A_Is64bitOS) ? DllCall("Kernel32.dll\GetTickCount64", "Int64") : DllCall("Kernel32.dll\GetTickCount", "UInt"))
;Is the same as:
If A_Is64bitOS
   Tick := DllCall("Kernel32.dll\GetTickCount64", "Int64") ;(A_PtrSize=64 bit&&Ptr=Int64)
Else
   Tick := DllCall("Kernel32.dll\GetTickCount", "Int") ;(A_PtrSize=32 bit&&Ptr=Int)
;Is the same as
If A_Is64bitOS
   Tick := DllCall("Kernel32.dll\GetTickCount64","Ptr")
Else
   Tick := DllCall("Kernel32.dll\GetTickCount","Ptr")
;Is the same as
If A_Is64bitOS
   Tick := DllCall("Kernel32.dll\GetTickCount64")
Else
   Tick := DllCall("Kernel32.dll\GetTickCount")
;Is the same as
Tick := ((A_Is64bitOS) ? DllCall("Kernel32.dll\GetTickCount64") : DllCall("Kernel32.dll\GetTickCount"))
Recommends AHK Studio
User avatar
jNizM
Posts: 2681
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: A_TickCount to use GetTickCount64 instead of GetTickCoun

10 Dec 2014, 10:14

Int64? ULONGLONG = A 64-bit unsigned integer = UInt64
or not?
[AHK] 1.1.33.02 x64 Unicode | [WIN] 10 Pro (Version 20H2) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
joedf
Posts: 7894
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: A_TickCount to use GetTickCount64 instead of GetTickCoun

10 Dec 2014, 10:31

ULONGLONG is UInt64 : http://msdn.microsoft.com/library/cc230393
Whatever works, works... :P
User avatar
nnnik
Posts: 4480
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: A_TickCount to use GetTickCount64 instead of GetTickCoun

10 Dec 2014, 10:33

There is no 64 bit Unsigned Integer in ahk. :D
Unsigned 64-bit integers produced by a function are not supported. Therefore, to work with numbers greater or equal to 0x8000000000000000, omit the U prefix and interpret any negative values received from the function as large integers. For example, a function that yields -1 as an Int64 is really yielding 0xFFFFFFFFFFFFFFFF if it is designed to yield a UInt64.
But there is something else that's wrong with my post.
I always thought that the standard return type is UPtr however it seems that it isn't.
Recommends AHK Studio
User avatar
joedf
Posts: 7894
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: A_TickCount to use GetTickCount64 instead of GetTickCoun

10 Dec 2014, 10:39

@nnnik hahahahah :)
just me
Posts: 7744
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: A_TickCount to use GetTickCount64 instead of GetTickCoun

10 Dec 2014, 10:49

Code: Select all

;Is the same as
If A_Is64bitOS
   Tick := DllCall("Kernel32.dll\GetTickCount64")
Else
   Tick := DllCall("Kernel32.dll\GetTickCount")
ReturnType: If the function returns a 32-bit signed integer (Int), BOOL, or nothing at all, ReturnType may be omitted. Otherwise, specify one of the argument types from the types table below. The asterisk suffix is also supported.
Also, there are 64-bit versions of Server 2003 and actually Win XP.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 3 guests