/** parses a string eg '5s' or '20m 22.123ms', returning the number of milliseconds it represents (rounded); * -1 on blank or "never" or "off" or "false"; * number of millis if no units specified. * * @throws NumberFormatException if cannot be parsed (or if null) */ public static long parseTimeString(String timeString) { return (long) parseTimeStringAsDouble(timeString); }
double dd = 0; if (timeString.length()>0) { dd = parseTimeStringAsDouble(timeString); if (dd==-1) { throw new NumberFormatException("cannot combine '"+timeString+"' with '"+num+" "+s+"'");