Throttle a function and cache the result for x milliseconds