This is a static copy of a profile report

Home

print>LocalPrint (40 calls, 34.025 sec)
Generated 05-Aug-2011 13:03:34 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/print.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
printfunction40
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
271
pj = render(pj,pj.Handles{i});
4021.849 s64.2%
259
pj = prepare( pj, h );
407.618 s22.4%
282
pj = restore( pj, h );
404.481 s13.2%
250
pj = positions( pj, pj.Handles...
400.077 s0.2%
311
end
400 s0%
All other lines  0 s0%
Totals  34.025 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
graphics/private/renderfunction4021.805 s64.1%
graphics/private/preparefunction407.618 s22.4%
graphics/private/restorefunction404.481 s13.2%
graphics/private/positionsfunction400.066 s0.2%
print>localIsPrintHeaderHeaderSpecEmptysubfunction400 s0%
print>LocalAdjustPrintParamsForDepViewersubfunction400 s0%
Self time (built-ins, overhead, etc.)  0.055 s0.2%
Totals  34.025 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function79
Non-code lines (comments, blank lines)33
Code lines (lines that can run)46
Code lines that did run24
Code lines that did not run22
Coverage (did run/can run)52.17 %
Function listing
   time   calls  line
233 function pj = LocalPrint(pj)
234
235 %Turning on the printjob structure
40 236 pj.Active = 1;
237
238 % rquist - moved here from above
239 % Printing parameters like paper position, paper size etc. needs to be
240 % adjusted for ModelDependencyViewer figure.
40 241 LocalAdjustPrintParamsForDepViewer(pj);
242
243 %Objects to print have their handles in a cell-array of vectors.
244 %Each vector is for one page; all objects in that vector
245 %are printed on the same page. The caller must have set their
246 %PaperPosition's up so they do not overlap, or do so gracefully.
40 247 numPages = length( pj.Handles );
40 248 for i = 1 : numPages
249 %numObjs = length( pj.Handles{i} );
0.08 40 250 pj = positions( pj, pj.Handles{i} );
251
252 %Only prepare and restore the first object.
40 253 h = pj.Handles{i}(1);
254 %Add object to current page
40 255 pj.Error = 0;
40 256 pj.Exception = [];
257 %May want to change various properties before printing depending
258 %upon input arguments and state of other HG/Simulink properties.
7.62 40 259 pj = prepare( pj, h );
260 %Call the output driver and render Figure/model to device, file, or clipboard.
261 %Save erroring out until we restore the objects.
40 262 try
40 263 if ishghandle(h) && ~localIsPrintHeaderHeaderSpecEmpty(h) && ...
264 (~pj.DriverExport || ...
265 strcmp(pj.DriverClass,'MW'))
266
267 ph=paperfig(h);
268 pj=render(pj,ph);
269 delete(ph);
40 270 else
21.85 40 271 pj = render(pj,pj.Handles{i});
40 272 end
40 273 if ~isempty(pj.Exception) %pj.Error
274 rethrow(pj.Exception)
275 end
276 catch ex
277 pj.Error = 1;
278 pj.Exception = ex;
279 end
280
281 %Reset the properties of a Figure/model after printing.
4.48 40 282 pj = restore( pj, h );
283
40 284 if pj.Error
285 if ~isempty(pj.Exception)
286 throw(pj.Exception);
287 else
288 throw(MException('MATLAB:print:PrintFailedException','print failed due to an unknown reason'));
289 end
290 end
291
40 292 if i < numPages
293 %Start a new page for next vector of handles
294 pj.PageNumber = pj.PageNumber + 1;
295 end
40 296 end
297
298 %Close connection with printer or file system.
40 299 pj.Active = 0;
300
40 301 if pj.GhostDriver
302 pj = ghostscript( pj );
303
40 304 elseif strcmp( pj.Driver, 'hpgl' )
305 hpgl( pj );
306 end
307
40 308 if pj.PrintOutput
309 send( pj );
310 end
40 311 end

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