Open
Description
Following is the code I used in my case:
import pywinctl as pwc
import sys
import time
from pynput import mouse
def on_click(x, y, button, pressed):
start = time.time()
if pressed:
print(f"Mouse button {button} pressed at position ({x}, {y})")
try:
print(pwc.getActiveWindow().title)
print("Latency:",time.time() - start)
except AttributeError:
print("No active window")
else:
print(f"Mouse button {button} released at position ({x}, {y})")
with mouse.Listener(on_click=on_click) as listener:
listener.join()
I ran this on a M1 Macbook pro. The latency is around 400ms to 500ms to just get the active window.
I ran this on another windows machine, the same code gave a latency around 1ms to almost none latency.
May I ask why does the performance vary this much? Or is there something I should do in MacOS for it run smoother?
Metadata
Metadata
Assignees
Labels
No labels