class TimeUtil {

    public static long parse(String window) {
        char c = window.charAt(window.length() - 1);
        int num = Integer.parseInt(window.substring(0, window.length() - 1));
        switch (c) {
            case 's':
                return num * 1000;
            case 'm':
                return num * 60 * 1000;
            case 'h':
                return num * 60 * 60 * 1000;
            case 'd':
                return num * 60 * 60 * 24 * 1000;
            default:
                throw new RuntimeException("error window format:" + window);
        }
    }

    private  TimeUtil();

}