A_TickCount to use GetTickCount64 instead of GetTickCount

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

Re: A_TickCount to use GetTickCount64 instead of GetTickCoun

10 Dec 2014, 09:48

[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
nnnik
Posts: 4500
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: 3183
Joined: 30 Sep 2013, 01:33
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] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
nnnik
Posts: 4500
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
just me
Posts: 9576
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 28 guests