Meaning: just in time (example)
Rewrite 1: in the tick of a tock
Rewrite 2: before the zeroes clicked over
Rewrite 3: before the bell buzzed
Rewrite 4: before a spark becomes a flame
Rewrite 5: before he could hit "send"
Comment: The last couple of examples are more moments than time, yet I think they equally apply.
Join me on Twitter: @a_copywriter
More on idioms
(commission may be paid on purchase)