16 Time and alarm library
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog C-library
        • Time and alarm library
          • alarm/4
          • alarm/3
          • alarm_at/4
          • install_alarm/1
          • install_alarm/2
          • uninstall_alarm/1
          • remove_alarm/1
          • current_alarm/4
          • call_with_time_limit/2
Availability::- use_module(library(time)).(can be autoloaded)
Sourcecall_with_time_limit(+Time, :Goal)
True if Goal completes within Time seconds. Goal is executed as in once/1. If Goal doesn't complete within Time seconds (wall time), exit using the exception 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 set_stream/2 or waiting for input using wait_for_input/3.