The nick is a cut or notch made on a piece of wood.
During medieval times, long before punch-in time clocks or other methods of modern tabulation, attendance, especially at schools and church services, was registered with a nick on a personalized stick of wood.
If someone failed to show up on time, no nick was recorded, for which there would be suitable punishment.
When we arrive at the last minute, we say we got there just in “the nick of time”.