private static Long parseTime(String time) throws NumberFormatException {
        time = time.trim();
        try {
            int unitOffset = findUnitOffset(time);
            double measure = Double.valueOf(time.substring(0, unitOffset));
            double multiplier = parseUnit(time.substring(unitOffset));
            return (long) (measure * multiplier);
        } catch (RuntimeException e) {
            throw new IllegalInputException("Error parsing '" + time + "'", e);
        }
    }
Tries to return the given object as a Long. If it is a Number, treat it
as a number of seconds, i.e. get a Long representation and multiply by
1000. If it has a String representation, try to parse this as a floating
point number, followed by by an optional unit (seconds and an SI prefix,
a couple of valid examples are "s" and "ms". Only a very small subset of
SI prefixes are supported). If no unit is given, seconds are assumed.

@param value some representation of a number of seconds
@param defaultValue returned if value is null
@return value as a number of milliseconds
@throws NumberFormatException if value is not a Number instance and its String
        representation cannot be parsed as a number followed optionally by time unit
container-search/src/main/java/com/yahoo/search/query/ParameterParser.java