This is a static copy of a profile report

Home

print (Calls: 12, Time: 10.915 s)
Generated 16-Jul-2020 17:08:49 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/printing/print.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
saveasfunction12
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
83
pj = alternatePrintPath(pj);
127.135 s65.4%
36
drawnow; % give changes a chan...
122.988 s27.4%
41
[pj, devices, options ] = inpu...
120.289 s2.6%
38
[pj, inputargs] = LocalCreateP...
120.219 s2.0%
67
pj = validate( pj );
120.128 s1.2%
All other lines  0.156 s1.4%
Totals  10.915 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
printing/private/alternatePrintPathfunction127.134 s65.4%
Legend.doUpdatefunction81.064 s9.7%
closereqfunction70.537 s4.9%
printing/private/inputcheckfunction120.287 s2.6%
print>LocalCreatePrintJobsubfunction120.217 s2.0%
printing/private/validatefunction120.127 s1.2%
...Manager>AxesLayoutManager.doUpdateclass method80.111 s1.0%
printing/private/handleSimulinkPrintingfunction120.108 s1.0%
...y.LegendEntry>LegendEntry.doUpdateclass method560.074 s0.7%
Legend.autoUpdateCallbackfunction80.043 s0.4%
namefunction120.021 s0.2%
UnsupportedInUifigurefunction120.015 s0.1%
...eObj,evtData)obj.cacheLoad(sourceObj)anonymous function100.015 s0.1%
Text.Text>Text.doUpdateclass method560.014 s0.1%
...nteractions.createDefaultInteractionsclass method120.007 s0.1%
Legend.Legend>Legend.getBackgroundColorclass method160.007 s0.1%
...ractions.createAndRegisterTextControlclass method920.006 s0.1%
prepareFigureForPrintfunction120.004 s0.0%
...r>@(e,d)obj.handleMouseExited(e,d)anonymous function20.003 s0.0%
Self time (built-ins, overhead, etc.)  1.119 s10.3%
Totals  10.915 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function90
Non-code lines (comments, blank lines)56
Code lines (lines that can run)34
Code lines that did run18
Code lines that did not run16
Coverage (did run/can run)52.94 %
Function listing
time 
Calls 
 line
   1 
function varargout = print( varargin )
   2 
%   PRINT Print or save a figure or model.
   3 
%     A subset of the available options is presented below. For more details
   4 
%     see <a href="matlab:helpview([docroot '/matlab/ref/print.html'])" />the documentation</a>.
   5 
%
   6 
%     PRINT, by itself, prints the current figure to your default printer.
   7 
%     Use the -s option to print the current model instead of the current figure.
   8 
%       print         % print the current figure to the default printer
   9 
%       print -s      % print the current model to the default printer
  10 
%
  11 
%     PRINT(filename, formattype) saves the current figure to a file in the
  12 
%     specified format. Vector graphics, such as PDF ('-dpdf'), and encapsulated
  13 
%     PostScript ('-depsc'), as well as images such as JPEG ('-djpeg') and PNG ('-dpng')
  14 
%     can be created. Use '-d' to specify the formattype option
  15 
%       print(fig, '-dpdf', 'myfigure.pdf'); % save to the 'myfigure.pdf' file
  16 
%     The full list of formats is <a href="matlab:helpview([docroot '/matlab/ref/print.html#inputarg_formattype'])" />documented here</a>.
  17 
%
  18 
%     PRINT(printer, ...) prints the figure or model to the specified printer.
  19 
%     Use '-P' to specify the printer option.
  20 
%       print(fig, '-Pmyprinter'); % print to the printer named 'myprinter'
  21 
%
  22 
%     PRINT(resize,...) resizes the figure to fit the page when printing.
  23 
%     The resize options are valid only for figures, and only for page
  24 
%     formats (PDF, and PS) and printers. Specify resize as either
  25 
%       '-bestfit'  to preserve the figure's aspect ratio or
  26 
%       '-fillpage' to ignore the aspect ratio.
  27 
%
  28 
%   <a href="matlab:helpview([docroot '/matlab/ref/print.html'])" />The documentation</a> contains additonal details and examples, including how to
  29 
%   specify the figure or model to print, adjust the output size and
  30 
%   resolution, save to the clipboard, and specify the renderer to use.
  31 
%
  32 
%   See also SAVEAS, PRINTPREVIEW, SAVEFIG, EXPORTGRAPHICS, COPYGRAPHICS.
  33 

  34 
%   Copyright 1984-2019 The MathWorks, Inc.
  35 

  2.988 
     12 
  36
drawnow; % give changes a chance to be processed 
  37 

  0.219 
     12 
  38
[pj, inputargs] = LocalCreatePrintJob(varargin{:}); 
  39 

  40 
%Check the input arguments and flesh out settings of PrintJob
  0.289 
     12 
  41
[pj, devices, options ] = inputcheck( pj, inputargs{:} ); 
  42 

  43 
% Process printing operation for simulink figure
  0.109 
     12 
  44
if handleSimulinkPrinting(pj) 
  45 
    return
< 0.001 
     12 
  46
end 
  47 

  48 
%User can find out what devices and options are supported by
  49 
%asking for output and giving just the input argument '-d'.
  50 
%Do it here rather then inputcheck so stack trace makes more sense.
< 0.001 
     12 
  51
if strcmp( pj.Driver, '-d' ) 
  52 
    if nargout == 0
  53 
        disp(getString(message('MATLAB:uistring:print:SupportedDevices')))
  54 
        for i=1:length(devices)
  55 
            disp(['    -d' devices{i}])
  56 
        end
  57 
    else
  58 
        varargout{1} = devices;
  59 
        varargout{2} = options;
  60 
    end
  61 
    %Don't actually print anything if user is inquiring.
  62 
    return
< 0.001 
     12 
  63
end 
  64 

  65 
%Validate that PrintJob state is ok, that input arguments
  66 
%and defaults work together.
  0.128 
     12 
  67
pj = validate( pj ); 
  68 

  69 
%Handle missing or illegal filename.
  70 
%Save possible name first for potential use in later warning.
  0.022 
     12 
  71
pj = matlab.graphics.internal.name( pj ); 
  72 

  73 
%Sometimes need help tracking down problems...
< 0.001 
     12 
  74
if pj.DebugMode 
  75 
    disp(getString(message('MATLAB:uistring:print:PrintJobObject')))
  76 
    disp(pj)
< 0.001 
     12 
  77
end 
  78 

  0.005 
     12 
  79
matlab.graphics.internal.prepareFigureForPrint(pj.Handles{1}); 
  0.016 
     12 
  80
matlab.ui.internal.UnsupportedInUifigure(pj.Handles{1}); 
  81 

  82 
%If handled via new path just return from here, otherwise fall through
  7.135 
     12 
  83
pj = alternatePrintPath(pj); 
< 0.001 
     12 
  84
if pj.donePrinting 
< 0.001 
     12 
  85
    if pj.RGBImage 
  86 
        varargout(1) = {pj.Return};
< 0.001 
     12 
  87
    end 
  0.002 
     12 
  88
    return; 
  89 
end
  90 
end

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