How to implement elapsed millis as the timer for my motor spinning time?

There are 3 stages . The stages flow continuously until the time in stage 3 have been completed. The motor must spins according to the time given. For example, for stage one, the speed is set :180 servo value , time: 30 second. The motor must spin at 180 speed within that 30 second. Once the 30second is finish, the motor then go to stage 2 , taking the speed(eg 123 servo value) and time(eg 20sec) that have been set for stage 2. After the motor finish spinning at 123 in 20 second, the motor then enter stage 3. Stage 3 with speed 103 and time 50 sec. Motor spin at speed of 103 and time 50 sec, once the 50sec is up, the motor stop immediately to speed of 0. Then , that's the end of the stages of motor flow. I hope this clarifies all.