Jump to content

Execution time different between MouseMove loop iterations.

Recommended Posts


Here's an example script: 

While 1
    $timer = TimerInit()
    MouseMove(20, 110)
    MouseMove(970, 270)
    MouseMove(640, 755)
    MouseMove(650, 550)
ConsoleWrite("TIME: " & @TAB & TimerDiff($timer) & @CRLF)

It shows different times for each iteration, the difference is miliseconds but it is only an example. In the bigger script I'm writing this difference grows to over 100ms. I tried the same with Control Clicks, and the difference almost dissapears, so I guess it is some unwated MouseMove delay that's beyond my control? Or is there a way to control it and make it work at steady speed?

Share this post

Link to post
Share on other sites

Originally no, but after adding 10 as speed to the above script, the difference is still there:

TIME:     3277.6767193562
TIME:     3290.17876390722
TIME:     3291.32816087588
TIME:     3287.45874113144
TIME:     3288.21086216065
TIME:     3290.16370779927
TIME:     3287.9538817726

Edited by Zero_T

Share this post

Link to post
Share on other sites

Did you try 0?
Either way, whatever you do it won't be exact and wondering what is so critical that this is required?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites

Speed 0 doesn´t make a difference. 

And the reason (critical or not) is that it's a part of a stress test script, with parameters like frequency. This script will possibly run for days/weeks, and I wanted to make sure that it is executed with the exact frequency supplied as a parameter. 

I guess I can work around that with some extra sleep-timer arithmetics, accepting set constant value as an execution time, and then sleeping the difference between that value and each iteration time. I'll work on that.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now