In the Nick of Time
Meaning:
Just in time, or at the last possible moment.
Example:
The hero always saves his damsel in distress in the nick of time.
Did you know?
This idiom stems from the fact that in the 1580s, a nick was known as a narrow and precise marker.
Reference: http://www.phrases.org.uk/meanings/in-the-nick-of-time.html