examples/whiteboard/public/main.js
function throttle(callback, delay) {
    var previousCall = new Date().getTime();
    return function() {
      var time = new Date().getTime();

      if ((time - previousCall) >= delay) {
        previousCall = time;
        callback.apply(null, arguments);
      }
    };
  }
function throttle(callback, delay) {
    var previousCall = new Date().getTime();
    return function() {
      var time = new Date().getTime();

      if ((time - previousCall) >= delay) {
        previousCall = time;
        callback.apply(null, arguments);
      }
    };
  }
function throttle ( callback , delay ) { var previousCall = new Date ( ) . getTime ( ) ; return function ( ) { var time = new Date ( ) . getTime ( ) ; if ( ( time - previousCall ) >= delay ) { previousCall = time ; callback . apply ( null , arguments ) ; } } ; }
limit the number of events per second
limit the number of events per second