mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
Author:halw
Date:2009-01-06T21:31:01.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@153 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -27,29 +27,29 @@ It is also possible to dynamically start and stop the profiler in a program. To
|
||||
In the root feature:
|
||||
|
||||
<code>
|
||||
local
|
||||
ps: PROFILING_SETTING
|
||||
-- Other local variables if necessary.
|
||||
do
|
||||
create ps.make
|
||||
ps.stop_profiling
|
||||
-- Real program execution.
|
||||
ps.start_profiling
|
||||
end</code>
|
||||
local
|
||||
ps: PROFILING_SETTING
|
||||
-- Other local variables if necessary.
|
||||
do
|
||||
create ps.make
|
||||
ps.stop_profiling
|
||||
-- Real program execution.
|
||||
ps.start_profiling
|
||||
end</code>
|
||||
|
||||
|
||||
And in the feature(s) that needs to be profiled:
|
||||
<code></code>
|
||||
<code>
|
||||
local
|
||||
ps: PROFILING_SETTING
|
||||
-- Other local variables if necessary.
|
||||
do
|
||||
create ps.make
|
||||
ps.start_profiling
|
||||
-- What needs to be profiled.
|
||||
ps.stop_profiling
|
||||
end</code>
|
||||
local
|
||||
ps: PROFILING_SETTING
|
||||
-- Other local variables if necessary.
|
||||
do
|
||||
create ps.make
|
||||
ps.start_profiling
|
||||
-- What needs to be profiled.
|
||||
ps.stop_profiling
|
||||
end</code>
|
||||
|
||||
|
||||
{{note|Even if the profiler should only work in certain sections of code, the '''Profiling''' check box of the [[General Target Options|Projects Settings]] dialog must be checked or the '''profile''' option must be set on certain clusters. }}
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
[[Property:uuid|78e0273d-525e-a338-dfe4-d5fc27cd06d3]]
|
||||
Eiffel provides ways to add debug code to features to help during their debugging. You may think of it as the well-known C construct: <code></code>
|
||||
|
||||
<code>#ifdef MY_DEBUG_FLAG/* Debug code is here */ #endif</code>
|
||||
<code lang=c>#ifdef MY_DEBUG_FLAG/* Debug code is here */ #endif</code>
|
||||
|
||||
|
||||
The corresponding construct in Eiffel is provided by the debug keyword. It is possible to wrap code inside a debug clause like this:
|
||||
<code></code>
|
||||
<code>
|
||||
debug("MY_DEBUG_FLAG")
|
||||
-- Debug code is here.
|
||||
end</code>
|
||||
debug("MY_DEBUG_FLAG")
|
||||
-- Debug code is here.
|
||||
end</code>
|
||||
|
||||
|
||||
It is then possible to enable or disable debug clauses globally.
|
||||
|
||||
Reference in New Issue
Block a user