def get_time_segments(sensor, segments):
    """
    Function to extract the start timestamps and end timestamps sorted from early to late from a feature segment
    :param sensor: sensor dimension of segment (int)
    :param segments: feature segments to extract the timestamps for
    :returns: starts and ends in sorted lists
    """
    starts = []
    ends = []
    for _, segment in segments:
        if segment[0] == sensor:
            starts.append(segment[1])
            ends.append(segment[2])
    starts_sorted = [start for start, _ in sorted(zip(starts, ends))]
    ends_sorted = [end for _, end in sorted(zip(starts, ends))]
    return starts_sorted, ends_sorted