This is a static copy of a profile reportHome
blinktxt>blinkcallback (29 calls, 0.078 sec)
Generated 15-Mar-2007 12:01:51 using real time.
M-subfunction in file c:\mind07\blinktxt.m
[Copy to new window for comparing multiple runs]
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
72 | drawnow | 14 | 0.063 s | 80.0% |  |
70 | set(txt,'String','') | 14 | 0.016 s | 20.0% |  |
80 | end | 2 | 0 s | 0% |  |
79 | delete(tmr) | 2 | 0 s | 0% |  |
78 | stop(tmr) | 2 | 0 s | 0% |  |
Other lines & overhead | | | 0 s | 0% |  |
Totals | | | 0.078 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
timer.stop | M-function | 2 | 0 s | 0% |  |
timer.delete | M-function | 2 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.078 s | 100.0% |  |
Totals | | | 0.078 s | 100% | |
M-Lint results
Line number | Message |
45 | Input variable 'evd' appears never to be used. |
Coverage results
[ Show coverage for parent directory ]
Total lines in file | 36 |
Non-code lines (comments, blank lines) | 22 |
Code lines (lines that can run) | 14 |
Code lines that did run | 14 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
45 function blinkcallback(tmr,evd,txt)
46 %BLINKCALLBACK callback function to create blinking effect
47
48 % when you use a cell array with a function handle to set the TimerFcn
49 % callback, the first two inputs will always be the handle for the timer
50 % and event data, in that order. Any additional elements in the cell array
51 % will become the third, fourth, fifth, etc. inputs
52
53 % use a try/catch block, if the figure is closed, and txt becomes an
54 % invalid handle, this will catch the error when you try to GET the String
55 % for txt
56
29 57 try
58 % check the current String value
29 59 str = get(txt,'String');
60
27 61 if isempty(str)
62 % get the stored string
13 63 str = get(txt,'UserData');
64 % use the stored string to restore the string
13 65 set(txt,'String',str);
66 % force MATLAB to redraw the figure
13 67 drawnow
14 68 else
69 % set to an empty string, to make it 'blink'
0.02 14 70 set(txt,'String','')
71 % force MATLAB to redraw the figure
0.06 14 72 drawnow
14 73 end
2 74 catch
75 % if there was an error, stop and delete the timer
76 % an error will occur if the figure is closed, since 'txt' will not be
77 % a valid handle anymore.
2 78 stop(tmr)
2 79 delete(tmr)
2 80 end