In generations one to four, extreme speed has the same priority as the other moves. In generation five, extreme speed has a+ 2 priority instead of + 1 like aqua jet, etc. If two moves of the same priority go, the pokemon with the higher speed stat would go first. If they have the same speed stat and the same priority move was used, then it will be randomized who goes first. Hope this helps!