The arguments
initialize
,
processes
,
profile-waiting
and
ignore-in-foreign
are passed to start-profiling. They have the same default values as for start-profiling, except
processes
which defaults to
:all
.

sleep
is the time to sleep in seconds. If
sleep
is
nil
or 0
do-profiling
does not sleep. Also, if
sleep
is supplied and either
function
or
func-and-args
are passed, it does not sleep.

func-and-args
, and
function
together with
arguments
, can both be used for calling a function you supply.
func-and-args
is either a list of the form
(
function-designator
.
args
)
, in which case
function-designator
is applied to the
args
, or it is a function designator which is called without arguments.
function
is applied to
arguments
.

The order of execution is first
func-and-args
(if this is non-nil), then
function
togeth with
arguments
if
function
is non-nil, and then sleep if
sleep
was passed explicitly or both
function
and
func-and-args
are
nil
.

Example

To profile whatever happens in the next 6 seconds:

(hcl:do-profiling)

To profile whatever happens in the next 10 minutes:

(hcl:do-profiling :sleep 600)

To run 4 processes in parallel with the same function and profile until they all die: