2 codes in 1 software

I need to run first code for a time interval, than code 2 for another time interval.