code: function setDeferredTimeout(deferred, delay) {
          var timer = setTimeout(function () {
              deferred.reject("timeout");
          }, delay);
          deferred.always(function () { clearTimeout(timer); });
      }
docs: 2^32 - 1 
  @private
  Helper function to auto-reject a deferred after a given amount of time.
  If the deferred is resolved/rejected manually, then the timeout is
  automatically cleared.