Toby Cannon
Toby Cannon

Reputation: 735

Run prolog program multiple times in sequence?

I have a prolog program of which I'm trying to do some analysis and establish the runtime. As time/1 gives the values in seconds, I'm just getting 0 recorded as it is not fine grain enough.

My plan to get around this is to run my Prolog program say 1000 times, find the runtime of this then simply divide by 1000 to give the runtime of the actual program. How do you run a prolog program multiple times to have this effect?

Upvotes: 1

Views: 485

Answers (1)

mat
mat

Reputation: 40768

Use for example:

?- between(1, 1 000, _),
   your_goal,
   false.

Upvotes: 4

Related Questions