Get partial results in Postgres in case of timeout?
There is nothing to do exactly what you want, making a query end normally on the server based on a time limit rather than a row LIMIT.  You could declare a cursor and then FETCH rows in chunks (perhaps chunks of 1), closing the cursor after a certain amount of time has passed as witnessed on the client. Depending on the driver you are using, there may be other options to get similar results, such as PQsetSingleRowMode in libpq.