Meaning of “in the nick of time” - Learner’s Dictionary

in the nick of time

just before it was too late:

The ambulance arrived in the nick of time.

(Definition of “in the nick of time” from the Cambridge Learner’s Dictionary © Cambridge University Press)