You never set `state` back from 1, so really the button push is starting an repeated call for taskExecute(); The variables `previousMillis` (1-3) are only ever initialised to zero. So if you wait a while before pressing the button, that delay time becomes part of the delay. If your `taskExecute()` function sets them before the loop, this will fix that: unsigned long time_now = millis(); previousMillis1 = time_now; previousMillis2 = time_now; previousMillis3 = time_now;