📄 eetimeloop.m
字号:
function eeTVOut = eetimeloop(eeTVIn, param, trialCount, loopCount1, ... loopName1, loopCount2, loopName2, ... loopCount3, loopName3)%EETIMELOOP In-loop estimation of execution time.%%--------%Synopsis:% eeTVOut = eetimeloop(eeTVIn, param, trialCount, loopCount1, loopName1)% eeTVOut = eetimeloop(eeTVIn, param, trialCount, loopCount1, ...% loopName1, loopCount2, loopName2, loopCount3, loopName3)%%Description:% In-loop estimation of execution time.% For the use of this function see the help text of function "eetimebegin".%%Output and Input:% eeTVOut (): Same as "eeTVOut" but is output and is to be used by% this function "eetimeloop" or the function "eetimeend".% eeTVIn (): A structure variable containing information for the % functions "eetimebegin", "eetimepreloop", "eetimeloop" and "eetimeend"% and it should not be manipulated directly by the user.% This variable is here the output of the function "eetimepreloop" or% this function "eetimeloop" itself. % param (): Not used.% trialCount (IntScalarT): Current loop count for the trial loop.% loopCount1 (IntScalarT): Current loop count for loop one.% loopName1 (StringT): Name of loop one.% loopCount2 [D](IntScalarT): Current loop count for loop two.% loopName2 [D](StringT): Name of loop two.% loopCount3 [D](IntScalarT): Current loop count for loop three.% loopName3 [D](StringT): Name of loop three.%%--------%Notations:% Data type names are shown in parentheses and they start with a capital% letter and end with a capital T. Data type definitions can be found in [1]% or by "help dbtdata".% [D] = This parameter can be omitted and then a default value is used.% When the [D]-input parameter is not the last used in the call, it must be% given the value [], i.e. an empty matrix.% ... = There can be more parameters. They are explained under respective% metod or choice.%%Examples:%%Software Quality:% (About what is done to ascertain software quality. What tests are done.)%%Known Bugs:% Using some control parameters under the windows platforms will result in% erroneous behavior, e.g. the character "\r" gives the same result as the% character "\n", LINE FEED and CARRIAGE RETURN. This program uses the "\r"% control parameter and will thus not work as intended under MS-platforms.%% Currently, a loop name for the trial loop cannot be given.%% It seems like that the total count "TotalL" never reaches the maximum in the % screen display.%%References:% [1]: Bj鱮klund S.: "DBT, A MATLAB Toolbox for Radar Signal Processing.% Reference Guide", FOA-D--9x-00xxx-408--SE, To be published.%%See Also:% eetimebegin, eetimepreloop, eetimeend, radio/wideex3% * DBT, A Matlab Toolbox for Radar Signal Processing *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.%% Start : 990222 Svante Bj鱮klund (svabj).% Latest change: $Date: 2000/10/16 15:40:13 $ $Author: svabj $.% $Revision: 1.8 $% *****************************************************************************% ****************** Add missing input parameters ******************arginNo=5;if (nargin < arginNo) error('DBT-Error: To few input parameters.')endarginNo = arginNo +1;if (nargin < arginNo) loopCount2 = [];endarginNo = arginNo +1;if (nargin < arginNo) loopName2 = [];endarginNo = arginNo +1;if (nargin < arginNo) loopCount3 = [];endarginNo = arginNo +1;if (nargin < arginNo) loopName3 = [];endarginNo = arginNo +1;% ****************** Default values ******************if isempty(loopCount2) loopCount2 = 1;end%ifif isempty(loopName2) loopName2 = 'lp2';end%ifif isempty(loopCount3) loopCount3 = 1;end%ifif isempty(loopName3) loopName3 = 'lp3';end%ifif (~isfield(eeTVIn,'preLoop')) error('The function "eetimebegin" must be called before "eetimepreloop".')end%if% **************** Display execution time information ****************% In: loopCount1, eeTVIn.noLoop1, trialCount, noTrials,% startClock, elapTimePreLoop, noTotalLoop, estTotTime% Out:eeTVOut = eeTVIn;%loopCount3, loopCount2, loopCount1,trialCounttotalLoopCount = (loopCount3-1)*eeTVIn.noLoop2 + ... (loopCount2-1)*eeTVIn.noLoop1 + ... (loopCount1-1)*eeTVIn.noTrials + ... trialCount;elapTime = etime(clock,eeTVIn.startClock);if ((elapTime > 300) | (totalLoopCount >= 5)) eeTVOut.estTotTime = ((elapTime - eeTVIn.elapTimePreLoop) * ... (eeTVIn.noTotalLoop / totalLoopCount)) + eeTVIn.elapTimePreLoop; %estTotTime = ((elapTime) * (eeTVIn.noTotalLoop/totalLoopCount));end%if[timeMsg, timeDiv] = crTimeStr(eeTVOut.estTotTime);if (0) fprintf(['Done: %s=%d(%d), trialL=%d(%d), TotalL=%d(%d), ', ... 'E.time=%.1f(%.1f)', timeMsg], loopName1, loopCount1, eeTVIn.noLoop1, ... trialCount, eeTVIn.noTrials, totalLoopCount, eeTVIn.noTotalLoop, ... elapTime/timeDiv, eeTVOut.estTotTime/timeDiv);elseprMsg = 'Done:';if (eeTVIn.noLoop3 > 1) prMsg = [prMsg, sprintf(' %s=%d(%d),',loopName3, loopCount3, eeTVIn.noLoop3)];end%ifif (eeTVIn.noLoop2 > 1) prMsg = [prMsg, sprintf(' %s=%d(%d),',loopName2, loopCount2, eeTVIn.noLoop2)];end%ifif (eeTVIn.noLoop1 > 1) prMsg = [prMsg, sprintf(' %s=%d(%d),',loopName1, loopCount1, eeTVIn.noLoop1)];end%ifprMsg = [prMsg, sprintf([' trialL=%d(%d), TotalL=%d(%d), E.time=%.1f(%.1f)', ... timeMsg,' \n'], trialCount, eeTVIn.noTrials, totalLoopCount, ... eeTVIn.noTotalLoop, elapTime/timeDiv, eeTVOut.estTotTime/timeDiv)];fprintf(prMsg)end%if (0)eeTVOut.loop = 1; % For checking that the function are called in right order.%endfunction eetimeloop
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -