.. index:: timeout
.. _timeout/0:

.. rst-class:: right

**object**

``timeout``
===========

Call goal with a time limit predicates.

| **Author:** Paulo Moura
| **Version:** 0.3
| **Date:** 2019/5/7

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Dependencies:**
|   (none)


| **Remarks:**


   - *Supported backend Prolog systems:* B-Prolog, ECLiPSe, SICStus Prolog, SWI-Prolog, and YAP.

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

.. raw:: html

   <div id="call_with_timeout/2"> </div>

.. index:: call_with_timeout/2
.. _timeout/0::call_with_timeout/2:

``call_with_timeout/2``
^^^^^^^^^^^^^^^^^^^^^^^

Calls a goal deterministically with the given time limit (expressed in seconds).

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``call_with_timeout(Goal,Timeout)``
| **Meta-predicate template:**
|    ``call_with_timeout(0,*)``
| **Mode and number of proofs:**
|    ``call_with_timeout(+callable,+positive_number)`` - ``zero_or_one``

| **Exceptions:**
|    Goal does not complete in the allowed time:
|        ``timeout(Goal)``


------------

Protected predicates
--------------------

(none)

Private predicates
------------------

(none)

Operators
---------

(none)

