The issue is that speed is not a constant even for a single device as it depends what else it is doing, if memory is available, if some task is clogging the CPU, etc... So if I were to do this, either I would try to set a flag in the other app if you can, or just wait long enough, or allow the function to fail gracefully if the other app is not up and try again a littler while later.