Timing of non-invasive ventilation