I have written code that changes the color of a mark the user places on an image (drawn on a Canvas element) based on how long the user holds down the click for. Currently, if the user holds down for less than a second, a blue mark appears; otherwise a green mark appears.
I want to create a way to let the user know that a second has passed since they started clicking, perhaps an indicator panel on the side changes color, etc. I have a timer that starts counting from when you start clicking. How do you create an event that triggers when that timer reaches one second?
Not sure if you are looking for something like this,
The setTimeout() method will wait the specified number of milliseconds, and then execute the specified function.