How to use Timer to exit LoopA,then run LoopB?

EDIT: Wrong Answer tomorrow i post right one now i am late

void loop(){
while (millis() < 10000) {
LoopA();
}
while (millis() < 2000) {
LoopB();
}
}

Are you looking for this