When you submit a transaction it starts to get propagated to all the network's nodes. After that some miner picks it up at some point and includes in his block. After that the miner may succeed in mining the block with your transaction. After that the block may or may not end up in the canonical chain.
So the possible delays are:
Transaction propagation ...
This is an old question, but recently I wrote a plugin for this kind of task. Usually, it makes fewer requests than Ethfinex's script does (usually, not always 😂).
Take a look: https://github.com/monosux/ethereum-block-by-date