Please note that the recommended version of Scilab is 6.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.
Returns the profiling results of a function
c = profile(fun)
a Scilab function
a nx3 matrix containing the profiling results:
c(i,1): number of times the line i of the function has been executed
c(i,2): cumulated CPU time [in seconds] spent to execute the line i of the function
c(i,3): Measurement of the interpreter effort to execute once the line i of the function [arbitrary unit]
profile on a function, the profiling of this function must have been first activated:
either by using the add_profiling command.
Once the function executed, calling
profile returns a matrix, where each row contains the profiling results for the corresponding function line (including the header line of the function), such as the number of calls, and the total CPU time spent in that line, and a measurement of the interpretor effort to execute the line, as following:
|Number of calls||Total CPU time (s)||Interpretor effort|
Here we can see that the 3th line of the function has been called 300 times, for a total CPU time of 3.59 seconds.
Note: due to the precision limit of CPU time measure (typically one micro second), some executed lines which execution is very fast may appear with a CPU total time of 0.