The software loop will be inaccurate if you need to execute other code, unless you calculate how much time responding to a button takes. And as soon as you change anything in the code, it's no longer accurate.
This is exactly what the on-chip timers were designed for. Now you probably will not have a timer which goes to 20 min, but you don't have to. Just figure out how many timer interrupts happen in 20 min and make a counter for the interrupts.