isValid method

bool isValid(
  1. int now,
  2. int timeout
)

Implementation

bool isValid(int now, int timeout) {
  var elapsed = now - time;
  return elapsed < timeout;
}