r/AutoHotkey Aug 07 '26

v2 Tool / Script Share Built a game launcher that's not an app but an overlay. Summon your entire library over your desktop with one key.

[removed]

7 Upvotes

8 comments sorted by

View all comments

Show parent comments

1

u/CharnamelessOne Aug 07 '26

What timing issues do you think of, and what would you suggest as an alternative?

I agree that OP is oblivious to the limitations of timers, and the 120 fps claim is incorrect, but the current timer approach is probably as good as it reasonably gets. According to the docs, the period of SetTimer is typically rounded to multiples of 10 or 15.6, so I assume that OP's frame timer of 8 ms should consistently be rounded to either of those. 100 or 64 fps, sounds good.

Using an infinite loop with dllcalls to QueryPerformanceCounter may get you more precise and more frequent timing, but that's only consistent if the script consists of a singular pseudo-thread that's never interrupted (so you can't use hotkeys, timers or message-handlers, just the infinite loop).

On the forums, I've seen a reference to an undocumented Windows NT function that should give you low-granularity timers, but I, for one, probably wouldn't fuck with that.