In the nick of time
In the nick of time means just in time or immediately before some deadline expires. The expression dates from the mid-17th century and derives from a much earlier expression in the nick, which means at the precise or exact moment. The latter largely archaic expression dates from the 16th century, where a nick was a small notch or groove carved in a piece of wood. In those days, people used nicks or notches in wood to keep track of time.