public MongoCursor MongoCursor::maxTimeMS    ( int $ms   )

MongoCursor::maxTimeMSSets a server-side timeout for this query

ms

Specifies a cumulative time limit in milliseconds to be allowed by the server for processing operations on the cursor.