I was reading about exchange to understand better how they execute my market-orders. So let's say I am sending a market order to buy one share of AAPL to NYSE.
When NYSE gets my order he looks at the best offer in his order book (so the lowest ask price) and then look at all the ask price on all the other exchanges (NASDAQ,...). If the best offer in NYSE order book is lower or equal than the best offer on all the other exchanges then NYSE execute my order with his order book otherwise it redirects my order to the exchange that has the best offer. Is that correct?
If this correct, I am wondering how all of this work because checking the offer on all the other exchanges takes time. So NYSE takes a lot of time before executing my order. And let's say the best offer is on NASDAQ then NYSE redirects my order to NASDAQ exchange but then the time my order travels to NASDAQ exchange maybe the offer on NASDAQ is not the best anymore. So how all of this work?