in the nick of time only just in time; just at the critical moment.
☞ Nick is used here in the sense of 'the precise moment of an occurrence or an event'. This form of the phrase dates from the mid 17th century, but in the (very) nick is recorded from the late 16th century.
1985Nini HermanMy Kleinian Home Time and again, when all seemed lost, I somehow won through in the nick of time.