I don't really feel that we have a decent solution for timers down to 1ms, which (Especially when trying to write mouse "Delta" movement scripts, is a bit of a pain.
QPX just doesn't quite scratch that itch for me...
So now that I am getting into C# coding, I thought I would try to implement something better.
I found an cool little library on Codeplex by Ken Loveday, so I wrapped that into a DLL, and added some tweaks to have it behave basically like SetTimer.
It uses Lexikos' CLR library to load the DLL and create a timer object from the DLL.
You pass it a Function Object and a time in the same format as SetTimer (in ms, negative to only fire once) and it fires the callback at the frequency you requested.
It's not 100% accurate, but it is pretty good (Especially once it settles down) and it goes down to 1ms, so you can, for example, get nice regular 1ms calls to mouse_event so your mouse moves smoothly.
Here is a demo script to map the arrow keys to mouse delta movement, with it making the DLL call once every millisecond.
Demo Script for MicroTimer
Converts Arrow Keys to mouse cursor, with 1ms move time for the mouse
MsgBox DLL Not found
asm := CLR_LoadLibrary("MicroTimer\MicroTimer.dll")
; Use CLR to instantiate a class from within the DLL
mt := asm.CreateInstance("MicroTimer")
XState := 0
YState := 0
XTimer := mt.Create(Func("MoveX"), 1)
YTimer := mt.Create(Func("MoveY"), 1)
DllCall("user32.dll\mouse_event", "UInt", 0x0001, "UInt", XState, "UInt", 0, "UInt", 0, "UPtr", 0)
DllCall("user32.dll\mouse_event", "UInt", 0x0001, "UInt", 0, "UInt", YState, "UInt", 0, "UPtr", 0)
global XState, XTimer
XState := evt
global YState, YTimer
YState := evt