We can use the function
(or its superset )
to carry out a non-polling "sleep while processing messages".
This function pumps messages for up to
milliseconds.
The kernel of the idea is merely to use the
function as a
surrogate for ,
pumping messages until the cumulative timeout has been reached.
There are a lot of small details to pay ...