profilefunction is the current profiling information as a character matrix. Each row of the return value corresponds to a function and contains three fields separated by commas. The first field is the total time corresponding to the function in seconds. The second field is the name of the function. If the function is local to a file, the third field is the name of the file. If the function is not local to a file, the third field is blank. The align function can be used to line up the fields in the return value. The sort function can be used to sort this information.
"on", profiling is turned on and the total time for each function is initialized as zero.
"off", profiling is turned off. This will free the memory that is used for profiling and it will make function calls and returns slightly faster.
O-Matrix will respond
function fac1(n) begin
if n == 1 then return 1d0
return n * fac1(n - 1)
function fac2(n) begin
fac = 1d0
for i = 1 to n begin
fac = fac * i
(Note that the times on your system will probably be different.) This shows that the
fac2function computes factorials faster than the
If you call the
profilefunction with no arguments when profiling is turned off, an error message will result.
You cannot call the
profilefunction from within another function.