The PROFILER procedure allows you to access the IDL Code Profiler. The IDL Code Profiler helps you analyze the performance of your applications. You can easily monitor the calling frequency and execution time for procedures and functions.

Calling Sequence

PROFILER [, Module]



The program to which changes in profiling will be applied. If Module is not specified, profiling changes will be applied to all currently-compiled programs.



Set this keyword to disable profiling of Module or of all compiled modules if Module is not specified.


Set this keyword to a specified variable in which to store the results of the REPORT keyword.


Set this keyword to report the results of profiling. If you enter a program at the command line, the PROFILER procedure will report the status of all the specified modules used either since the beginning of the IDL session, or since the PROFILER was reset.


Set this keyword to clear the results of profiling.


Set this keyword to profile IDL system procedures and functions. By default, only user-written or library files, which have been compiled, are profiled.


PROFILER, /SYSTEM ; Include IDL system procedures and functions when profiling.

A= DIST(500) ; Create a dataset using the library function DIST. Note that DIST is immediately compiled.

TV, A ; Display the image.

PROFILER, /REPORT ; Retrieve the profiling results.

IDL prints:

Module Type Count Only(s) Avg.(s) Time(s) Avg.(s)

FINDGEN  (S) 1 0.000239 0.000239 0.000239 0.000239

FLTARR  (S) 1 0.010171 0.010171 0.010171 0.010171

N_ELEMENTS     (S) 1 0.000104 0.000104 0.000104 0.000104

ON_ERROR       (S) 1 0.000178 0.000178 0.000178 0.000178

SQRT   (S) 251 0.099001 0.000394 0.099001 0.000394

TV   (S) 1 2.030000 2.030000 2.030000 2.030000

See Also

"Debugging in IDL", Programming Tools .