Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slower KeyTap on first call #669

Open
zhengpd opened this issue Jul 16, 2024 · 0 comments
Open

slower KeyTap on first call #669

zhengpd opened this issue Jul 16, 2024 · 0 comments

Comments

@zhengpd
Copy link

zhengpd commented Jul 16, 2024

The first call of KeyTap takes more time than subsequent call. Any way to reduce the execution time?

package main

import (
	"time"
	"fmt"

	"github.com/go-vgo/robotgo"
)

func main() {
	robotgo.KeySleep = 1

	start1 := time.Now()
	robotgo.KeyTap("left")
	fmt.Printf("1st elapsed %s \n", time.Since(start1))

	start2 := time.Now()
	robotgo.KeyTap("left")
	fmt.Printf("2nd elapsed %s", time.Since(start2))
}
1st elapsed 96.107292ms 
2nd elapsed 4.535375ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant