myloop(X) :- time_out(q(X),1200,Res), X1 is X+1, (X mod 10000 =:= 0 -> statistics(walltime,WT),format('Result for ~w = ~w walltime(~w)~n',[X,Res,WT]) ; true), myloop(X1).
Calls:
Name: RECURSIVE_CALL/1
Name: true
Name: format/2
Name: statistics/2
Name: =:=/2
Name: ->/3
Name: is/2
Name: time_out/3
q(X) :- X >0.
Name: >/2
test :- time_out(myloop(1),550,R), print(R),nl.
Name: nl
Name: print/1