This is a static copy of a profile reportHome
timer.start (2 calls, 0.109 sec)
Generated 15-Mar-2007 12:01:50 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\matlab\iofun\@timer\start.m
[Copy to new window for comparing multiple runs]
Parents (calling functions)
Function Name | Function Type | Calls |
blinktxt | M-function | 2 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
40 | obj.jobject(lcv).start; % star... | 2 | 0.094 s | 85.7% |  |
45 | end | 2 | 0.016 s | 14.3% |  |
34 | alreadyRunning = false; | 2 | 0.000 s | 0.0% |  |
33 | err = false; | 2 | 0.000 s | 0.0% |  |
50 | elseif err % throw actual erro... | 2 | 0 s | 0% |  |
Other lines & overhead | | | 0 s | 0% |  |
Totals | | | 0.109 s | 100% | |
Children (called functions)
M-Lint results
No M-Lint messages.Coverage results
[ Show coverage for parent directory ]
Total lines in file | 64 |
Non-code lines (comments, blank lines) | 25 |
Code lines (lines that can run) | 39 |
Code lines that did run | 14 |
Code lines that did not run | 25 |
Coverage (did run/can run) | 35.90 % |
Function listing
time calls line
1 function start(obj)
2 %START Start timer(s) running.
3 %
4 % START(OBJ) starts the timer running, represented by the timer
5 % object, OBJ. If OBJ is an array of timer objects, START starts
6 % all the timers. Use the TIMER function to create a timer object.
7 %
8 % START sets the Running property of the timer object, OBJ, to 'On',
9 % initiates TimerFcn callbacks, and executes the StartFcn callback.
10 %
11 % The timer stops running when one of the following conditions apply:
12 % - The number of TimerFcn callbacks executed equals the number
13 % specified by the TasksToExecute property.
14 % - The STOP(OBJ) command is issued.
15 % - An error occurs while executing a TimerFcn callback.
16 %
17 % See also TIMER, TIMER/STOP.
18
19 % RDD 11-20-2001
20 % Copyright 2001-2002 The MathWorks, Inc.
21 % $Revision: 1.3 $ $Date: 2002/03/14 14:34:54 $
22
23
2 24 len = length(obj);
2 25 if ~all(isJavaTimer(obj.jobject))
26 if len==1
27 error('MATLAB:timer:invalid',timererror('MATLAB:timer:invalid'));
28 else
29 error('MATLAB:timer:someinvalid',timererror('MATLAB:timer:someinvalid'));
30 end
31 end
32
< 0.01 2 33 err = false;
< 0.01 2 34 alreadyRunning = false;
2 35 for lcv = 1:len % foreach object in OBJ array
2 36 if (obj.jobject(lcv).isRunning == 1) % if timer already running, flag as error/warning
37 alreadyRunning = true;
2 38 else
2 39 try
0.09 2 40 obj.jobject(lcv).start; % start the timer
41 catch
42 err = true; % flag as error/warning needing to be thrown at end
43 end
2 44 end
0.02 2 45 end
46
2 47 if (len==1) % if OBJ is singleton, above problems are thrown as errors
2 48 if alreadyRunning
49 error('MATLAB:timer:start:alreadystarted',timererror('MATLAB:timer:start:alreadystarted'));
2 50 elseif err % throw actual error
51 lerr = fixlasterr;
52 error(lerr{:});
53 end
54 else % if OBJ is an array, above problems are thrown as warnings
55 if alreadyRunning
56 state = warning('backtrace','off');
57 warning('MATLAB:timer:start:alreadystarted',timererror('MATLAB:timer:start:alreadystarted'));
58 warning(state);
59 elseif err
60 state = warning('backtrace','off');
61 warning('MATLAB:timer:errorinobjectarray',timererror('MATLAB:timer:errorinobjectarray'));
62 warning(state);
63 end
64 end