Skip to content

Instantly share code, notes, and snippets.

@lancelot-koh
lancelot-koh / defer 1
Last active August 29, 2015 14:16 — forked from kof/defer 1
(function(global){
var $ = global.jQuery || global,
D = Date,
now = D.now || function() {
return (new D).getTime();
};
// if once is true, fn will be executed only once if called more then one times during the time in delay.
// if once is not defined or false, fn will be executed periodically, period is delay.