Skip to content

Instantly share code, notes, and snippets.

@mzkaramat
Forked from KartikTalwar/JavaScriptRepeat.js
Created February 20, 2020 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzkaramat/49266429b719dd74a1b7118f25479021 to your computer and use it in GitHub Desktop.
Save mzkaramat/49266429b719dd74a1b7118f25479021 to your computer and use it in GitHub Desktop.
Make a JavaScript function repeat every x seconds
function refreshData()
{
x = 5; // 5 Seconds
// Do your thing here
setTimeout(refreshData, x*1000);
}
refreshData(); // execute function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment