mouse icon indicating copy to clipboard operation
mouse copied to clipboard

How can I do mouse.click() action faster?

Open tanghaitao2019 opened this issue 5 years ago • 3 comments

Now mouse.click() action need about 10-20ms, this API is faster than pynput(~20ms) and pyautogui(~ 100ms). It is awesome. But I want to write a fishing bot to some games. 10-20ms means I cannot catch the fish in 100% probability. So how can I do mouse.click() action faster?

tanghaitao2019 avatar Jan 14 '20 05:01 tanghaitao2019

Yeah, I want to know about this option if is possible, thank you

Amacorp avatar Jul 05 '20 11:07 Amacorp

Hi, sorry for the late comment. Could you please attach the code you used in order to measure the time of the mouse.click() function?

Also, what operating system are you using?

SamiTumarov avatar Aug 28 '20 15:08 SamiTumarov

Hi, I have tested the time it takes to execute the function mouse.click on Windows 10 With the following code

'''python from mouse import click import timeit

def mouseclick(): click()

execution_time = timeit.timeit(mouseclick, number = 1000) / 1000 print(("each click took on average {0} milliseconds").format(execution_time * 1000)) '''

The results were the following: "each click took on average 0.3585888 milliseconds"

Can you please attach the code you used to test the function execution time?.

SamiTumarov avatar Aug 28 '20 17:08 SamiTumarov