def METHOD_NAME(sensor, profile):
    """
    Wait a few seconds to be sure that frames are at steady state after start
    Count number of received frames for seconds_to_count_frames seconds and compare actual fps to requested fps
    """
    seconds_till_steady_state = 4
    seconds_to_count_frames = 20
    steady_state = False
    first_frame_received = False
    frames_received = 0
    first_frame_stopwatch = Stopwatch()
    def frame_cb(frame):
        global first_frame_seconds
        nonlocal steady_state, frames_received, first_frame_received
        if not first_frame_received:
            first_frame_seconds = first_frame_stopwatch.get_elapsed()
            first_frame_received = True
        if steady_state:
            frames_received += 1
    sensor.open(profile)
    sensor.start(frame_cb)
    first_frame_stopwatch.reset()
    time.sleep(seconds_till_steady_state)
    steady_state = True
    time.sleep(seconds_to_count_frames) # Time to count frames
    steady_state = False # Stop counting    
    sensor.stop()
    sensor.close()
    fps = frames_received / seconds_to_count_frames
    return fps