hggetbehavior>localGet (Calls: 32, Time: 0.047 s)
Generated 16-Jul-2020 17:09:26 using performance time.
subfunction in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/hggetbehavior.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
hggetbehavior | function | 32 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
93 | b = hgbehaviorfactory(bn,h); | 32 | 0.026 s | 55.6% | |
91 | b = localPeek(h,bn); | 32 | 0.004 s | 9.3% | |
95 | if ~dosupport(b,h) | 32 | 0.004 s | 8.8% | |
99 | set(h,'Behavior',bb); | 32 | 0.004 s | 8.7% | |
79 | bb = get(h,'Behavior'); | 32 | 0.003 s | 5.6% | |
All other lines | 0.006 s | 12.0% | |||
Totals | 0.047 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
hgbehaviorfactory | function | 32 | 0.025 s | 53.2% | |
hggetbehavior>localPeek | subfunction | 32 | 0.004 s | 8.7% | |
PrintBehavior>PrintBehavior.dosupport | class method | 16 | 0.002 s | 3.4% | |
...ehavior>PlotEditBehavior.dosupport | class method | 16 | 0.002 s | 3.3% | |
Self time (built-ins, overhead, etc.) | 0.015 s | 31.5% | |||
Totals | 0.047 s | 100% |
Total lines in function | 38 |
Non-code lines (comments, blank lines) | 8 |
Code lines (lines that can run) | 30 |
Code lines that did run | 21 |
Code lines that did not run | 9 |
Coverage (did run/can run) | 70.00 % |
time | Calls | line | |
---|---|---|---|
76 | function [ret_h] = localGet(h,behavior_name) | ||
77 | % ToDo: Optimize to avoid excessive looping | ||
78 | |||
0.003 | 32 | 79 | bb = get(h,'Behavior'); |
< 0.001 | 32 | 80 | ret_h = []; |
81 | |||
< 0.001 | 32 | 82 | if ischar(behavior_name) |
< 0.001 | 32 | 83 | behavior_name = {behavior_name}; |
< 0.001 | 32 | 84 | end |
85 | |||
86 | % Note that ret_h cannot be used to accumulate both MCOS and UDD behavior | ||
87 | % objects. This should not happen currently since hggetbehavior is not | ||
88 | % called with a cell array of behavior_names. | ||
< 0.001 | 32 | 89 | for n = 1:length(behavior_name) |
< 0.001 | 32 | 90 | bn = behavior_name{n}; |
0.004 | 32 | 91 | b = localPeek(h,bn); |
0.001 | 32 | 92 | if isempty(b) |
0.026 | 32 | 93 | b = hgbehaviorfactory(bn,h); |
< 0.001 | 32 | 94 | if ~isempty(b) |
0.004 | 32 | 95 | if ~dosupport(b,h) |
96 | error(message('MATLAB:hggetbehavior:UnsupportedHandle')) | ||
< 0.001 | 32 | 97 | end |
0.001 | 32 | 98 | bb(1).(behavior_name{n}) = b; |
0.004 | 32 | 99 | set(h,'Behavior',bb); |
< 0.001 | 32 | 100 | if isempty(ret_h) |
< 0.001 | 32 | 101 | ret_h = b; |
102 | else | ||
103 | ret_h(end+1) = b; %#ok<AGROW> | ||
< 0.001 | 32 | 104 | end |
< 0.001 | 32 | 105 | end |
106 | else | ||
107 | if isempty(ret_h) | ||
108 | ret_h = b; | ||
109 | else | ||
110 | ret_h(end+1) = b; %#ok<AGROW> | ||
111 | end | ||
< 0.001 | 32 | 112 | end |
< 0.001 | 32 | 113 | end |
Other subfunctions in this file are not included in this listing.