MatrixBerryCore
ProfileInfo.m
Go to the documentation of this file.
1 classdef ProfileInfo<handle
2 
3  properties (Access=private,Hidden)
4  % start time of profiling
5  tStart
6  % elapsed time of profiling
7  tElapsed
8  end
9 
10  methods
11  function self=ProfileInfo()
12 
13  self.tStart=[];
14  self.tElapsed=[];
15  end
16 
17  function tic(self)
18 
19  self.tStart=tic;
20  self.tElapsed=[];
21  end
22 
23  function resTime=toc(self)
24  import mxberry.core.throwerror;
25  %
26  if ~isempty(self.tElapsed)
27  resTime=self.tElapsed;
28  elseif ~isempty(self.tStart)
29  resTime=toc(self.tStart);
30  self.tElapsed=resTime;
31  else
32  throwerror('wrongInput',...
33  'You must call TIC before calling TOC');
34  end
35  end
36 
37  function resTime=process(self,profCaseName)
38 
39  resTime=self.toc();
40  end
41  end
42 end
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
PROFILEINFO contains profiling info obtaining during exectution of some code.
Definition: ProfileInfo.m:5