Against the clock

Close up photo of a watch face
You are working against the clock or against time when you are working fast to finish something by a specific time.
This idiom is drawn from timed competitions where there is a fixed time for a contest.

He was racing against the clock to finish his assignment on time.