I need a predicate to be called when a certain point in time occurs. I have events that should fire events after 2 hours, how can I do that?
Can use sleep/1 to nicely wait.
and what will happen to the program, it will not work all this time? It must be asynchronous
The standard answer is the same as with a program written in C/C++/Python/etc. - use threads.
They’re documented here.
Note that there are some useful utilities for threading, such as concurrent/3.
Threads are most likely the right starting point. The scheduling can be based on alarm/3,4 and related predicates, simple sleep/1 or the more advanced thread wait predicates such as thread_wait/2 or thread_get_message/3. The latter two allow for specifying an absolute point in time to wakeup (deadline)