def ms_to_timestamp(ms):
    """
    Convert milliseconds to timestamp string.
    """
    hour = ms // (3600 * 1000)
    ms = ms - hour * (3600 * 1000)
    minute = ms // (60 * 1000)
    ms = ms - minute * (60 * 1000)
    sec = ms // 1000
    ms = ms - sec * 1000
    ten_ms = ms // 10
    timestamp_str = '%s:%s:%s.%s' % (int(hour), int(minute), int(sec),
                                     int(ten_ms))
    return timestamp_str