This is a static copy of a profile report

Home

name>fixTilde (Calls: 12, Time: 0.001 s)
Generated 16-Jul-2020 17:09:16 using performance time.
subfunction in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/printing/+matlab/+graphics/+internal/name.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
namefunction12
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
116
if (isunix && (length(...
120.001 s55.7%
113
persistent homeDir; % keep tra...
120.000 s18.9%
117
if (fileName(1) == '~' &&a...
120.000 s0.5%
134
end
120.000 s0.4%
133
end
120.000 s0.3%
All other lines  0.000 s24.1%
Totals  0.001 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
isunixfunction120.000 s4.3%
Self time (built-ins, overhead, etc.)  0.001 s95.7%
Totals  0.001 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function23
Non-code lines (comments, blank lines)8
Code lines (lines that can run)15
Code lines that did run6
Code lines that did not run9
Coverage (did run/can run)40.00 %
Function listing
time 
Calls 
 line
 112 
function filename = fixTilde(fileName)
< 0.001 
     12 
 113
persistent homeDir; % keep track of user's home dir 
< 0.001 
     12 
 114
filename = fileName; 
 115 
% yes, we tested for isunix above...but in case that test gets deleted
< 0.001 
     12 
 116
if (isunix && (length(fileName) > 1)) 
< 0.001 
     12 
 117
    if (fileName(1) == '~' && fileName(2) == filesep) 
 118 
        if isempty(homeDir)
 119 
            % save current location,
 120 
            % go 'home' and remember that location
 121 
            % switch back to original location
 122 
            currDir = pwd;
 123 
            cd('~');
 124 
            homeDir = pwd;
 125 
            cd(currDir);
 126 
        end
 127 
        if ~isempty(homeDir)
 128 
            % now that we know where the home dir is
 129 
            % replace 1st char (~) with user's home dir and take rest of
 130 
            % path specified
 131 
            filename = [homeDir fileName(2:end)];
 132 
        end
< 0.001 
     12 
 133
    end 
< 0.001 
     12 
 134
end 

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