Mercurial > octave
comparison scripts/general/profshow.m @ 21634:96518f623c91
Backed out changeset dcf8922b724b
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Wed, 20 Apr 2016 11:06:03 -0700 |
parents | dcf8922b724b |
children |
comparison
equal
deleted
inserted
replaced
21633:dcf8922b724b | 21634:96518f623c91 |
---|---|
74 nameLen = max (length ("Function"), | 74 nameLen = max (length ("Function"), |
75 columns (char (data.FunctionTable(p(1:n)).FunctionName))); | 75 columns (char (data.FunctionTable(p(1:n)).FunctionName))); |
76 headerFormat = sprintf ("%%4s %%%ds %%4s %%12s %%10s %%12s\n", nameLen); | 76 headerFormat = sprintf ("%%4s %%%ds %%4s %%12s %%10s %%12s\n", nameLen); |
77 rowFormat = sprintf ("%%4d %%%ds %%4s %%12.3f %%10.2f %%12d\n", nameLen); | 77 rowFormat = sprintf ("%%4d %%%ds %%4s %%12.3f %%10.2f %%12d\n", nameLen); |
78 | 78 |
79 fprintf (headerFormat, ... | 79 printf (headerFormat, ... |
80 "#", "Function", "Attr", "Time (s)", "Time (%)", "Calls"); | 80 "#", "Function", "Attr", "Time (s)", "Time (%)", "Calls"); |
81 fprintf ("%s\n", repmat ("-", 1, nameLen + 2 * 5 + 11 + 2 * 13)); | 81 printf ("%s\n", repmat ("-", 1, nameLen + 2 * 5 + 11 + 2 * 13)); |
82 | 82 |
83 for i = 1 : n | 83 for i = 1 : n |
84 row = data.FunctionTable(p(i)); | 84 row = data.FunctionTable(p(i)); |
85 timePercent = 100 * row.TotalTime / totalTime; | 85 timePercent = 100 * row.TotalTime / totalTime; |
86 attr = ""; | 86 attr = ""; |
87 if (row.IsRecursive) | 87 if (row.IsRecursive) |
88 attr = "R"; | 88 attr = "R"; |
89 endif | 89 endif |
90 fprintf (rowFormat, p(i), row.FunctionName, attr, | 90 printf (rowFormat, p(i), row.FunctionName, attr, |
91 row.TotalTime, timePercent, row.NumCalls); | 91 row.TotalTime, timePercent, row.NumCalls); |
92 endfor | 92 endfor |
93 | 93 |
94 endfunction | 94 endfunction |
95 | 95 |