var throttle = function (interval, callback) {
'use strict';
var lastExecution = Date.now() - interval;
return function () {
if ((lastExecution + interval) <= Date.now()) {
lastExecution = Date.now();
callback.apply(this, arguments);
}
};
};
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.