State is two numbers: the token count and the last refill time. A leaky bucket used as a meter makes the same decisions.