Add an example of plotprofile with an exec instead of a deff 19/10219/3
Sylvestre Ledru [Tue, 15 Jan 2013 13:51:42 +0000 (14:51 +0100)]
Change-Id: I616bc70d277435a0d9c75c4b03946090a3c7f137

scilab/modules/functions/help/en_US/profiling/plotprofile.xml

index 60a364d..fba448a 100644 (file)
@@ -77,6 +77,30 @@ foo(30)
 //get execution profiles
 plotprofile(foo) // click on Exit to exit
   ]]></programlisting>
+        
+        <programlisting role="example"><![CDATA[ 
+// with the exec function
+tmpfile = TMPDIR + "/myFunction.sci";
+mputl(["function myFunction()"
+       "runs = 50;"
+       "b = 0;"
+       "for i = 1:runs"
+       "  b = zeros(220, 220);"
+       "    for j = 1:220"
+       "      for k = 1:220"
+       "        b(k,j) = abs(j - k) + 1;"
+       "      end"
+       "    end"
+       "end"
+       "endfunction"], tmpfile);
+
+exec(tmpfile)
+add_profiling("myFunction");
+myFunction();
+
+//get execution profiles
+plotprofile(myFunction) // click on Exit to exit
+  ]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>