I have a menu that slides out when you hover over a small area of the screen. This menu then slides back in when your mouse leaves the menu area.
I have been running into what I feel are UX issues where if you accidentally mouse out of the menu it slides in immediately and I find it to be a minor annoyance.
To combat this I have added a debounce handler to slide the menu back in after a specified amount of time, and to cancel that if the user returns their mouse to the menu area in that amount of time.
Is there a "correct" amount of time that will prevent users from being annoyed by accidentally closing the moment their mouse leaves the menu, and prevent them from being annoyed that their menu hasn't closed yet when they do decide they want to close it?