profile

Profile execution time for Macro functions.

Syntax

  • profile on

  • profile off

  • profile resume

  • profile clear

  • status = profile('status')

  • p = profile('info')

  • profile('show', sortOption)

  • profile('show', sortOption, nbLines)

Input argument

  • sortOption - a string: 'nfl' by name file line, 'line' by line, 'percalls', 'totaltime', 'filename', 'function' or 'nbcalls'.

  • nbLines - a integer value: number of lines to display.

Description

Profiling is a way to measure where Macro function spend times.

s = profile('status') returns a structure with the current status of the profiler.

p = profile('info') returns a structure with collected profiling data.

profile('on') starts profiler.

profile('off') stops profiler. Collected profiling data will be retrieved later with p = profile ('info').

profile('clear') clears collected profiling data.

profile('resume') restarts and continue and extends collected profiling data.

Examples

profile on
sind(5)
profile off
profile('show')
profile('show', 'totaltime')
profile('show', 'totaltime', 4)
profile on
sind(5)
profile off
profsave(profile('info'), [tempdir(), 'profile_results'])
unix([tempdir(), 'profile_results/index.html'])

See also

profsave.

History

Version
Description

1.0.0

initial version

Author

Allan CORNET

Last updated