If you want to have something occur every day at the same time, is there a reliable way to code in a very long delay?

Say you want to turn on the pump once every 24 hours, or what ever. Besides using a variable and incrementing it after a small delay, is there anything more to be done here?