How long does execAndWait wait?

I have a script that is executed using execAndWait. The script triggers an action that makes 2 calls to the server, however it appears that only the first call is registered on WPT. What determines how long it waits?