If you truely need to wait for a time interval in milliseconds, you can instead use the Windows API "Sleep" function. "LibFunc>Kernel32,Sleep,Sres,1" will cause a Macro Scheduler script to pause for 1 millisecond.
The following script is a proof of this statement. The script will initially run 100 cycles of a Wait> function that starts at 1 millisecond then will increment upward at 1 millisecond intervals. The timed results of each 100 cycle loop will display in a message box. You will see that every 1 millisecond increment will run 100 Wait> cycles in about 1600 milliseconds until you reach a 16 millisecond pause at which point each loop of 100 Wait> cycles will take about 3200 milliseconds. When you reach 32 milliseconds per pause the 100 cycles loop time will take about 4500 milliseconds. Etc.
When you close the message box the script will move on to perform the same process but will use Windows API Sleep rather than Wait. As you watch the Sleep function pause time increment you will also see that the 100 cycle loop time increments as well. This indicates that the Windows API Sleep function actually pauses the script in millisecond increments.
Code: Select all
Message>Waiting...
Let>vWTime=0.000
Let>vContinue=1
While>vContinue=1
Let>vWTime=%vWTime%+0.001
GoSub>TimeOut
IfWindowOpen>Macro Scheduler Message
Else
Let>vContinue=0
EndIf
EndWhile
SRT>TimeOut
Timer>vStartTime
Let>kk=0
Repeat>kk
Add>kk,1
Wait>vWTime
Until>kk=100
Timer>vEndTime
Let>vTime=%vEndTime%-%vStartTime%
SetControlText>Macro Scheduler Message,TMemo,1,Wait Time = %vWTime% seconds%crlf%100 cycles took %vTime% miliseconds
END>TimeOut
Message>Waiting...
Let>vWTime=0
Let>vContinue=1
While>vContinue=1
Let>vWTime=%vWTime%+1
GoSub>APITimeOut
IfWindowOpen>Macro Scheduler Message
Else
Let>vContinue=0
EndIf
EndWhile
SRT>APITimeOut
Timer>vStartTime
Let>kk=0
Repeat>kk
Add>kk,1
LibFunc>Kernel32,Sleep,Sres,vWTime
Until>kk=100
Timer>vEndTime
Let>vTime=%vEndTime%-%vStartTime%
SetControlText>Macro Scheduler Message,TMemo,1,Sleep Time = %vWTime% milliseconds%crlf%100 cycles took %vTime% miliseconds
END>APITimeOut