A bit more precise solution is to substract the elapsed time from 5 hours every time. It may happen that a timer event gets stalled, so substracting a second every time it is triggered might get your timer out of sync. But if you don't expect a heavy load, it should work fine too.
Bookmarks