Home > Archive > Prolog > August 2005 > newbie question: how to measure run-time with Sicstus under linux?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
newbie question: how to measure run-time with Sicstus under linux?
|
|
| ouyang.jie@gmail.com 2005-08-11, 9:03 am |
| staticstics(runtime,_) is for windows. Am I right?
| |
| Paulo Moura 2005-08-12, 4:02 am |
|
Duncan Patton wrote:
> On 11 Aug 2005 06:31:15 -0700
> ouyang.jie@gmail.com wrote:
>
>
> Use GDB on your prolog runtime. Might need to stop the compiler
> from stripping symbols. To do this you'll probably need to
> build it yourself and not load an rpm.
With the relevance of your answer to the original question being...?!?
On Logtalk, I use the following definition to get runtime time in
seconds, for all operating-systems supported by SICStus Prolog:
'$lgt_cpu_time'(Seconds) :-
statistics(runtime, [Miliseconds| _]),
Seconds is Miliseconds / 1000.
Morevover, SICStus Prolog documentation is available on-line for
further details:
http://www.sics.se/sicstus/docs/lat...l/sicstus.html/
Cheers,
Paulo
| |
| Paulo Moura 2005-08-12, 5:03 pm |
|
Duncan Patton wrote:
> On 12 Aug 2005 01:45:46 -0700
> "Paulo Moura" <pmoura@di.ubi.pt> wrote:
>
>
> "Measuring" a runtime on Linux. Without specific reference to internal
> prolog stuff.
>From the SICStus Prolog on-line manual:
http://www.sics.se/sicstus/docs/lat...ml#State%20Info
statistics(?Key,?Value)
This allows a program to gather various execution statistics. For each
of the possible keys Key, Value is unified with a list of values, as
follows:
....
runtime
[since start of Prolog,since previous statistics] These refer to CPU
time used while executing, excluding time spent garbage collecting,
stack shifting, or in system calls. The second element is the time
since the last call to statistics/2 with this key. It is not affected
by calls to statistics/0.
In addtion, SICStus Prolog is not open-source, so it's unlikely that
the original post could build it itself for using with GDB.
Cheers,
Paulo
| |
| Bart Demoen 2005-08-12, 5:03 pm |
| Paulo Moura wrote:
> In addtion, SICStus Prolog is not open-source, so it's unlikely that
> the original post could build it itself for using with GDB.
Academics can get a source license (the sources are the most interesting
thing about SICStus Prolog for me :-)
And then making a version with the -g option active, is a piece of cake.
Cheers
Bart Demoen
|
|
|
|
|