Function parseTimeString

  • Parses a human-readable time string into milliseconds.

    Parameters

    • timeString: string

      The time string to parse.

    Returns number

    The parsed milliseconds.

    Example

    // 1000
    parseTimeString('1s')

    Example

    // 61000
    parseTimeString('1m1s')

    Example

    // 3661000
    parseTimeString('1h 1m 1s')

    Example

    // 1000
    parseTimeString('foo 1s bar')