Skip to content

Instantly share code, notes, and snippets.

@interactiveRob
Last active March 9, 2018 20:27
Show Gist options
  • Save interactiveRob/1c024999f9ee433a97cef36690998a50 to your computer and use it in GitHub Desktop.
Save interactiveRob/1c024999f9ee433a97cef36690998a50 to your computer and use it in GitHub Desktop.
run function after a delay
setTimeout(function(){
//do something after 600 milliseconds
}, 600);
@interactiveRob
Copy link
Author

You can use this function to delay 600ms before executing your desired code. Having trouble? Read through your JS more and make sure this function is executed when you want it to run. Can be used inside any other functions, e.g. onclick functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment