This is a static copy of a profile reportHome
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 Name | Function Type | Calls |
print | function | 40 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
271 | pj = render(pj,pj.Handles{i}); | 40 | 21.849 s | 64.2% |  |
259 | pj = prepare( pj, h ); | 40 | 7.618 s | 22.4% |  |
282 | pj = restore( pj, h ); | 40 | 4.481 s | 13.2% |  |
250 | pj = positions( pj, pj.Handles... | 40 | 0.077 s | 0.2% |  |
311 | end | 40 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 34.025 s | 100% | |
Children (called functions)
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 79 |
Non-code lines (comments, blank lines) | 33 |
Code lines (lines that can run) | 46 |
Code lines that did run | 24 |
Code lines that did not run | 22 |
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.