Very confused about timing.

Aimed at how to simulate multitasking with millis(), but provides an extended explanation on how it works:

http://www.cmiyc.com/blog/2011/01/06/millis-tutorial/

millis() will work in this application, but you would be able to write much simpler code if you wired up a RTC (such as the ds1307).