The following example shows two agents that behave in accordance with two timers.
go:-
timer(T1,100),
timer(T2,1000),
ping(T1),
pong(T2),
repeat,fail.
ping(T),{time(T)} => write(ping),nl.
pong(T),{time(T)} => write(pong),nl.
Notice that the two calls 'repeat,fail' are needed after the two agents are created. Without them, the query go would succeed before any time event is posted and thus neither of the agent could get a chance to be activated.