expiresAfter static method

TimeBounds expiresAfter(
  1. int timeout
)

A factory method that sets maxTime to the specified timeout second from now. timeout in seconds.

Implementation

static TimeBounds expiresAfter(int timeout) {
  int now = (DateTime.now().millisecondsSinceEpoch / 1000).round();
  int endTime = now + timeout;
  return TimeBounds(0, endTime);
}