How to remain inside a function?

Ok I think I found my problem. I have a while (millis() < 80000) statement in each of my branch functions as usually this is the time for the initial calibration of my sensor. I measure the minimum and maximum value of my sensor in this time. Obviously by the time the serial connection is made with the Leonardo the millis is already counting down.
I will have to find another way to delay the calibration feature. This sensor has no buttons or switches that i can use as it just operates when you plug in the USB.