private long checkFreeze() {
    final long current = System.currentTimeMillis();
    final long previous = myPeriodBegin;
    if (previous > 0L && current - previous > EXPECTED_DELTA_MS) {
      myPeriods.add(new TimeRange(previous, current));
      LOG.info("System sleep/hibernate detected from " + new Date(previous) + " till " + new Date(current) + "; " + StringUtil.formatDuration(current - previous));
    }
    myPeriodBegin = current;
    return SLEEP_INTERVAL_MS - (System.currentTimeMillis() - current);
  }
private long checkFreeze()