Jump to content

Recommended Posts

Posted

Mouseclick takes so much more processor load than mousemove, even with 100x times more sleep. What is the mechanism behind mouseclick?

HotKeySet("{ESC}", "ExitApp")

for $i = 1 to 100
Mouseclick("left", 144, 303, 1, 0)
Sleep (100)
Mouseclick("left",606, 303, 1, 0)
Sleep (100)

next

Func ExitApp()
    Exit
EndFunc

HotKeySet("{ESC}", "ExitApp")

for $i = 1 to 100
Mousemove(144, 303, 0)
Sleep (1)
Mousemove(606, 303, 0)
Sleep (1)

next

Func ExitApp()
    Exit
EndFunc
Posted (edited)

It uses mouse_event function. Not sure what you mean though. I get the same cpu values for both scripts. I also swapped sleep values, re-ran and got the same outcome.

Edit: I should say it used to use mouse_event. That might have changed.

Edited by Beege
Posted

It uses mouse_event function. Not sure what you mean though. I get the same cpu values for both scripts. I also swapped sleep values, re-ran and got the same outcome.

Edit: I should say it used to use mouse_event. That might have changed.

Why such terrible effect on my computer from mouseclicks? Autoit and machine are up to date
Posted

Be careful with Sleep(1), that can be confusing. 1-9 still take 10 ms as you can see by timing it.

$iTotal = 0
For $iX = 1 To 100
    $iTimer = TimerInit()
    Sleep(1)
    $iTotal += TimerDiff($iTimer)
Next

ConsoleWrite("Average is " & $iTotal/ ($iX - 1) & " ms" & @LF)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...