Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.0 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.

Scilab Help >> Advanced functions > profiling > add_profiling

add_profiling

Enables the profiling of a function

Calling Sequence

add_profiling(funname)

Arguments

funname

A character string, the name of the function to be profiled

Description

add_profiling adds the instructions needed for the profiling of a function. Then, when this function is executed, the number of calls and the time spent, for each line, are stored. These data can be returned with the profile function.

Examples

function x=foo(a, n)
 x=0;
 for i=1:n
   if x<10 then
     x=x+a
   else
     x=x+1
   end  
 end
 x=x^2+1
endfunction

add_profiling("foo")
foo(0.1,100) //run the function
profile(foo) //extract profile information

See Also

Used Functions

This function uses the Scilab functions bytecode and walkbytecode

Report an issue
<< profiling profiling plotprofile >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Fri Apr 11 14:07:05 CEST 2014