SWI-Prolog Did You Know Did you know? the Profiler can speed up your code Search Documentation:
Predicate read_pending_chars/3