This is a static copy of a profile report

Home

hggetbehavior>localGet (Calls: 6, Time: 0.047 s)
Generated 18-May-2021 16:05:25 using performance time.
subfunction in file /usr/local/MATLAB/R2021a/toolbox/matlab/graphics/hggetbehavior.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
hggetbehaviorfunction6
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
93
b = hgbehaviorfactory(bn,h);
60.037 s80.3%
91
b = localPeek(h,bn);
60.002 s5.1%
95
if ~dosupport(b,h)
60.002 s3.9%
99
set(h,'Behavior',bb);
60.001 s2.6%
79
bb = get(h,'Behavior');
60.001 s1.8%
All other lines  0.003 s6.3%
Totals  0.047 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
hgbehaviorfactoryfunction60.030 s65.2%
hggetbehavior>localPeeksubfunction60.002 s4.4%
...avior>DataCursorBehavior.dosupportclass method60.001 s2.1%
Self time (built-ins, overhead, etc.)  0.013 s28.3%
Totals  0.047 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function38
Non-code lines (comments, blank lines)8
Code lines (lines that can run)30
Code lines that did run21
Code lines that did not run9
Coverage (did run/can run)70.00 %
Function listing
time 
Calls 
 line
  76 
function [ret_h] = localGet(h,behavior_name)
  77 
% ToDo: Optimize to avoid excessive looping
  78 

< 0.001 
      6 
  79
bb = get(h,'Behavior'); 
< 0.001 
      6 
  80
ret_h = []; 
  81 

< 0.001 
      6 
  82
if ischar(behavior_name) 
< 0.001 
      6 
  83
    behavior_name = {behavior_name}; 
< 0.001 
      6 
  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 
      6 
  89
for n = 1:length(behavior_name) 
< 0.001 
      6 
  90
     bn = behavior_name{n}; 
  0.002 
      6 
  91
     b = localPeek(h,bn); 
< 0.001 
      6 
  92
     if isempty(b) 
  0.037 
      6 
  93
        b = hgbehaviorfactory(bn,h); 
< 0.001 
      6 
  94
        if ~isempty(b)  
  0.002 
      6 
  95
            if ~dosupport(b,h) 
  96 
                error(message('MATLAB:hggetbehavior:UnsupportedHandle'))  
< 0.001 
      6 
  97
            end 
< 0.001 
      6 
  98
            bb(1).(behavior_name{n}) = b; 
  0.001 
      6 
  99
            set(h,'Behavior',bb); 
< 0.001 
      6 
 100
            if isempty(ret_h) 
< 0.001 
      6 
 101
                ret_h = b; 
 102 
            else
 103 
                ret_h(end+1) = b; %#ok<AGROW>
< 0.001 
      6 
 104
            end 
< 0.001 
      6 
 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 
      6 
 112
     end 
< 0.001 
      6 
 113
end 

Other subfunctions in this file are not included in this listing.