accept-process-output is a built-in function in `C source code'.

(accept-process-output &optional PROCESS SECONDS MILLISEC JUST-THIS-ONE)

Allow any pending output from subprocesses to be read by Emacs.
It is given to their filter functions.
Optional argument PROCESS means do not return until output has been
received from PROCESS.

Optional second argument SECONDS and third argument MILLISEC
specify a timeout; return after that much time even if there is
no subprocess output. If SECONDS is a floating point number,
it specifies a fractional number of seconds to wait.
The MILLISEC argument is obsolete and should be avoided.

If optional fourth argument JUST-THIS-ONE is non-nil, accept output
from PROCESS only, suspending reading output from other processes.
If JUST-THIS-ONE is an integer, don't run any timers either.
Return non-nil if we received any output from PROCESS (or, if PROCESS
is nil, from any process) before the timeout expired.