The engine does not need to be on but the side stand does need to be up.Um don't think the bike needs to be on - just the key turned far enough for the dash to light up.
How long do you have to hold both buttons?Not too hard. Hold both buttons on the dash until it starts to blink. Then hit the button on the right to adjust the one that's blinking. Then hit the button to the left to change to the other side, and same procedure. Owners manual explains it best. Also, but bike on center stand and turn it on. Won't work otherwise.