loop delay without initial startup delay

I have this line so that everything will only happen once per minute:

if (millis() - loopMillis > 60000UL) { //do every minute

Is there a simple way to change it so that it will run initially on startup, so it doesn't have to wait the first minute? I could put every in the setup, too, but there's a lot of code happening-pretty much my whole loop code.

Just run it in setup as you mentioned.

Or set the initial value of loopMillis to 60001UL

If you decide to do the initial code execution from setup() then put the code that is triggered each minute into a function and call that from setup() then call it from loop() once the minute has elapsed.

when you declare a value for loopMillis so that the first check passes.
unsigned long loopMillis = 0xffff0217;

So if millis() returns 3000 after the bootloader runs and your sketch starts up, then
3000 = 0xbb8
0xbb8 - 0xffff0217 = 0x000109a1 = 68004 decimal, which is >60000UL.

Should do the trick.

I just thought of moving everything to a separate function, that could be called from setup, as well as loop. But I like the sneaky definition of loopMillis the best! Thanks.

@Crossroards
Very nice woz.

Thanks 8)