/**
Throttles a call to a method based on the time between calls. This method is attached
var fn = Y.throttle(function() {
counter++;
});
for (i; i< 35000; i++) {
out++;
fn();
}
@module yui
@submodule yui-throttle
*/
/*! Based on work by Simon Willison: http://gist.github.com/292562 */
/**
* Throttles a call to a method based on the time between calls.
* @method throttle
* @for YUI
* @param fn {function} The function call to throttle.
* @param ms {int} The number of milliseconds to throttle the method call.
* Can set globally with Y.config.throttleTime or by call. Passing a -1 will
* disable the throttle. Defaults to 150.
* @return {function} Returns a wrapped function that calls fn throttled.
* @since 3.1.0
*/
if (ms === -1) {
return (function() {
});
}
return (function() {
}
});
};