View Full Version : Timer Web App

08-09-2012, 06:40 PM

I want to make a Timer web-based application with Javascript (may need to throw jquery in there, not sure yet).

Here's the basis of the application. It's actually to help keep time with football practice.

Basically, I'll type in
15 min of this period
20 min of this period
30 min of this period

Then, the program calculates the times when I hit the "Start" button. And it alerts us when there are 5 minutes left in the period, 1 minute in the period, and the end of the period.

I've attached what I have so far.

I know there must be a more efficient way of doing this. If you have any suggestions let me know. It calculates times correctly. But, I can't figure out how to have it alert me when there is 5 min left, 1 min left, and the end of each period. It's hard because I have the updateClock() function run every second, and javascript uses milliseconds. So I can't compare the timestamps of each.

Any thoughts?