Run the main loop also if no wifi is availibe

would a proper workaround be:

 -- void setup()
##setup internet and stuff
-- void loop()
##if conected reset timer
#else timer interrupt to 10min or so than recheck 
#run normal code every loop