function runFunc(endDate) {
      lastCall = +new Date();
      func.apply(context, args);
      $interval(function() {queued = null; }, 0, 1, false);
    }
@ngdoc method
@name throttle
@methodOf ui.grid.service:GridUtil

@param {function} func function to throttle
@param {number} wait milliseconds to delay after first trigger
@param {Object} options to use in throttle.

@returns {function} A function that can be executed as throttled function

@description
Adapted from debounce function (above)
Potential keys for Params Object are:
   trailing (bool) - whether to trigger after throttle time ends if called multiple times
Updated to use $interval rather than $timeout, as protractor (e2e tests) is able to work with $interval,
but not with $timeout

Note that when using throttle, you need to use throttle to create a new function upfront, then use the function
return from that call each time you need to call throttle.  If you call throttle itself repeatedly, the lastCall
variable will get overwritten and the throttling won't work

@example
<pre>
var throttledFunc =  gridUtil.throttle(function() {console.log('throttled');}, 500, {trailing: true});
throttledFunc(); //=> logs throttled
throttledFunc(); //=> queues attempt to log throttled for ~500ms (since trailing param is truthy)
throttledFunc(); //=> updates arguments to keep most-recent request, but does not do anything else.
</pre>