Logtalk 2.17.2 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1076 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -1,21 +1,35 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.17.1
|
||||
Release 2.17.2
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
||||
|
||||
To load all objects in this example consult the profiling.loader utility
|
||||
file.
|
||||
To load all entities in this example compile and load the loader file:
|
||||
|
||||
| ?- logtalk_load(loader).
|
||||
|
||||
You will also need to load the following files in the library directory:
|
||||
types.loader, events.loader, metapredicates.loader, and dates.loader (note
|
||||
that the *.loader files are Prolog files). Alternatively, you may load the
|
||||
library/all.loader file to load all library entities.
|
||||
|
||||
types_loader, events_loader, metapredicates_loader, and dates_loader.
|
||||
Alternatively, you may simply load the library all_loader file to load all
|
||||
library entities.
|
||||
|
||||
This is a very simple example of the use of events and monitors to make
|
||||
profilers for an application. It's easy to modify to make it do much more.
|
||||
For instance, most Prolog compilers give you access to data concerning space
|
||||
usage (stacks, heap, etc).
|
||||
|
||||
The example defines three objects:
|
||||
|
||||
message_counter
|
||||
using events, this object allows us to count the messages sent to
|
||||
spied objects
|
||||
|
||||
stop_watch
|
||||
using events, this object simply prints the cpu time before and after
|
||||
a message sent to a spied object
|
||||
|
||||
timer
|
||||
this object implements a method that sends a message to an object a
|
||||
specified number of times, returning the average execution time
|
||||
|
@@ -1,11 +1,17 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.17.1
|
||||
Release 2.17.2
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
||||
|
||||
% start by loading the example:
|
||||
|
||||
| ?- logtalk_load(loader).
|
||||
...
|
||||
|
||||
|
||||
%% message_counter example
|
||||
|
||||
|
||||
|
6
Logtalk/examples/profiling/loader.lgt
Normal file
6
Logtalk/examples/profiling/loader.lgt
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
:- initialization(
|
||||
logtalk_load([
|
||||
timer,
|
||||
message_counter,
|
||||
stop_watch])).
|
Reference in New Issue
Block a user