private static int parseMillis ( Input s ) { if ( s . index < s . len && s . getChar ( ) == ' ' ) { int startIndex = ++ s . index ; int ms = parseInt ( s ) ; int len = s . index - startIndex ; for ( ; len < 3 ; len ++ ) ms *= 10 ; for ( ; len > 3 ; len -- ) ms /= 10 ; // truncate because it's easier than rounding. return ms ; } return 0 ; }
Parse the fractional seconds field from the input returning the number of milliseconds and truncating extra places .