/** * Creates a new time based rate limit. * <p> * Calling {@link #check()} on will only return <tt>true</tt> every after the given amount of time has be passed * since the last time it returned <tt>true</tt>. Returns <tt>false</tt> otherwise. * * @param interval the amount of time after a call to {@link #check()} returns <tt>true</tt> again * @param unit the unit for amount * @return a new time based rate limit */ public static RateLimit timeInterval(long interval, TimeUnit unit) { return nTimesPerInterval(interval, unit, 1); }