private static int parseTimeString(String s){
  if (s == null) {
    return -1;
  }
  if (s.endsWith("s")) {
    int seconds=parsePositiveIntString(s.substring(0,s.length() - 1));
    return (seconds < 0) ? -1 : (seconds * 1000);
  }
 else {
    return parsePositiveIntString(s);
  }
}

private static int parseTimeString ( String s ) { if ( s == null ) { return - 1 ; } if ( s . endsWith ( "s" ) ) { int seconds = parsePositiveIntString ( s . substring ( 0 , s . length ( ) - 1 ) ) ; return ( seconds < 0 ) ? - 1 : ( seconds * 1000 ) ; } else { return parsePositiveIntString ( s ) ; } }
parses a time value string . if it ends with " s " , parses as seconds . otherwise , parses as milliseconds .
