The warm-up should be the same for speed work in training as in a meet to eliminate variables. If you only need 40m for your warm-up for speed in practice, it should be the same for a meet.
Actual workout body time depends on what you’re doing. SE might be 20 to 45min with two runs and the rest of the time used up by recovery between the reps.