public MongoCursor MongoCursor::timeout    ( int $ms   )

MongoCursor::timeoutSets a client-side timeout for this query

ms

The number of milliseconds for the cursor to wait for a response. Use -1 to wait forever. By default, the cursor will wait 30000 milliseconds (30 seconds).