Hi David, I wrote a small module to help benchmark time in library(profiler(profiler_extra)), just see the following example that measure the reverse/2 predicate:
:- module(_, _, []).
:- use_module(library(profiler(profiler_extra))). :- use_module(library(lists)).
mytest(Time) :- length(List, 1000), measure(reverse(List, _Rev), Time).
By default the time is given in the maximum resolution unit available in the system. In Intel, for example, it is given in cpu cycles. For milliseconds, you can use measure(Goal, walltime, Time). Just see the ciao/contrib/profiler/profiler_extra.pl file, I guess it is not too difficult to follow. Best Regards,
Edison.
2012/5/13 David Nolen <dnolen.lists(a)gmail.com>
How do people run simple timing tests in Ciao? In SWI-Prolog I can do the following:
benchmark1 :- flag(benchmark,_,0), repeat, zebra1(Houses, WaterDrinker, ZebraOwner), flag(benchmark,N,N+1), N = 1000, !. benchmark :- time(benchmark1).
What is the equivalent in Ciao?
Thanks! David
Ciao-users mailing list Ciao-users(a)clip.dia.fi.upm.es http://clip.dia.fi.upm.es/cgi-bin/mailman/listinfo/ciao-users