private long calcNextTime(){
  long nextTime=Long.MAX_VALUE;
  for (int i=0; i < _groups.length; i++) {
    WatchdogGroup group=_groups[i];
    long gTime=group._time;
    long gWaitInterval=group._waitInterval;
    nextTime=Math.min(nextTime,gTime + gWaitInterval);
  }
  for (int i=0; i < _groups.length; i++) {
    WatchdogGroup group=_groups[i];
    group._doTimeout=(nextTime == group._time + group._waitInterval);
  }
  return nextTime;
}

private long calcNextTime ( ) { long nextTime = Long . MAX_VALUE ; for ( int i = 0 ; i < _groups . length ; i ++ ) { WatchdogGroup group = _groups [ i ] ; long gTime = group . _time ; long gWaitInterval = group . _waitInterval ; nextTime = Math . min ( nextTime , gTime + gWaitInterval ) ; } for ( int i = 0 ; i < _groups . length ; i ++ ) { WatchdogGroup group = _groups [ i ] ; group . _doTimeout = ( nextTime == group . _time + group . _waitInterval ) ; } return nextTime ; }
calculate the next time watchdog should run . all watchdog groups are checked for the closest time .
