beat the clock
Finish something or succeed before time is up, as in The paper went to press at five o'clock, and they hurried to beat the clock. The term comes from various sports or races in which contestants compete within a certain time limit.
The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.