Skip to content

Instantly share code, notes, and snippets.

@pwlin
Created May 26, 2010 20:18
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 pwlin/414987 to your computer and use it in GitHub Desktop.
Save pwlin/414987 to your computer and use it in GitHub Desktop.
var deltatime = 24 * 60 * 60; // 24h
var last = GM_getValue("lastcheck", new Date().getTime() / 1000);
if (new Date().getTime() / 1000 - last > deltatime) {
checkUpdates();
GM_setValue("lastcheck", Math.round(new Date().getTime() / 1000));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment