timer_create/2

Creates a timer and binds a callback predicate to it.

timer_create(+Callback, -Timer)

timer_create/2 creates a timer and binds the callback predicate Callback to it. The timer object will be unified with Timer. A timer has to be deleted with timer_close/1.
If Callback is 'null' than no callback predicate will be bound to the timer. This may be useful, if you want to check explicitly the state of the timer (running or elapsed) with the predicate timer_is_active/1. If Callback is a compound term and its first argument is a variable, then the callback predicate will be called with the Timer as it's first argument.

Arguments

Callback            predicate (compound or atom)
Timer               timer

This predicate is not part of the ISO-Prolog Standard.

See also

timer_close/1, timer_create/2, timer_is_active/1, timer_start/2, timer_stop/1.


Darueber read on...