code: private boolean executionIsTimedOut(long aStartTime, int aTimeout) {
          if (aTimeout != 0) {
              long now = System.currentTimeMillis() / 1000;
              if ((now - aStartTime) >= aTimeout) {
                  return true;
              }
          }
          return false;
      }
docs: Check whether or not the command execution reach the timeout value.
  
  @param aStartTime A start time in seconds.
  @param aTimeout   A timeout value in seconds.
  @return true if it reaches timeout.