 call_with_time_limit(+Time, 
:Goal)
call_with_time_limit(+Time, 
:Goal)time_limit_exceeded. See catch/3.
Please note that this predicate uses alarm/4 and therefore its effect on long-running foreign code and system calls is undefined. Blocking I/O can be handled using the timeout option of read_term/3.