Package arc.util
Class Ratekeeper
java.lang.Object
arc.util.Ratekeeper
Keeps track of X actions in Y units of time.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
occurences
public int occurences -
lastTime
public long lastTime
-
-
Constructor Details
-
Ratekeeper
public Ratekeeper()
-
-
Method Details
-
allow
public boolean allow(long spacing, int cap) - Parameters:
spacing
- the spacing between action chunks in millisecondscap
- the maximum amount of actions per chunk- Returns:
- whether an action is allowed.
-