2%> This is the base
class for generating objects
3%> that can time interval consecutively.<br>
6%> The main utility of
this timer
class
7%> is its dynamic ``del()`` method
which
8%> can compute the time elapsed since the
9%> last measurement in one function call.
12%> The ``handle`` superclass is essential to allow
13%>
object modification by the
object methods.<br>
16%> See the documentation of the
class constructor.<br>
19%> See below
for information on the attributes (properties).<br>
22%> See below
for information on the methods.<br>
27%> \JoshuaOsborne, May 21 2024, 5:47 AM, University of Texas at Arlington<br>
28%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
29%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
30classdef
Timer < pm.matlab.Handle
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 properties(Access =
protected)
38 %> The scalar MATLAB real containing the most recent
39 %> timing since the construction of the timer.<br>
42 %> This is an internal ``
protected``
class attribute
43 %> that is inaccessible to the end users.<br>
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54 %> The scalar MATLAB real containing the timer start.<br>
57 %> This is an internal ``Hidden``
class attribute
58 %> that is inaccessible to the end users.<br>
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 methods(Access =
public)
68 %> Return a scalar
object of
class [pm.timing.Timer](@ref
Timer).<br>
71 %> This is the constructor of the
class [pm.timing.Timer](@ref
Timer).<br>
74 %> ``self`` : The output scalar
object of
class [pm.timing.Timer](@ref
Timer).<br>
79 %> self = pm.timing.
Timer()
84 %> \include{lineno} example/timing/
Timer/main.m
86 %> \include{lineno} example/timing/
Timer/main.out.m
91 %> \JoshuaOsborne, May 21 2024, 5:49 AM, University of Texas at Arlington<br>
92 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
93 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
94 function self =
Timer()
99 %> Reset the timer, equivalent to reconstructing the timer
object.<br>
100 %> This is a dynamic method of the class [pm.timing.
Timer](@ref
Timer).
105 %> timer = pm.timing.
Timer()
113 %> \JoshuaOsborne, May 21 2024, 5:50 AM, University of Texas at Arlington<br>
114 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
115 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
122 %> Return a scalar MATLAB ``real`` containing the time
123 %> past since the (re)construction of the timer
object.<br>
126 %> Also, set the ``clock`` attribute of the parent
object.<br>
127 %> This is a dynamic method of the
class [pm.timing.Timer](@ref
Timer).<br>
130 %> ``clock`` : The output scalar MATLAB ``real`` containing the time
131 %> past since the (re)construction of the timer
object.<br>
136 %> timer = pm.timing.Timer()
137 %> clock = timer.toc()
144 %> \JoshuaOsborne, May 21 2024, 5:58 AM, University of Texas at Arlington<br>
145 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
146 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
147 function clock = toc(self)
148 self.clock = toc(self.start);
153 %> Return a scalar MATLAB ``real`` containing the time past
154 %> since the last time measurement by the timer
object.<br>
155 %> Also, set the ``clock`` attribute of the parent
object.<br>
156 %> This is a dynamic method of the
class [pm.timing.Timer](@ref
Timer).<br>
159 %> ``delta`` : The output scalar MATLAB ``real`` containing the time
160 %> past since the last time measurement by the timer
object.<br>
165 %> timer = pm.timing.Timer()
166 %> delta = timer.del()
172 %> \JoshuaOsborne, May 21 2024, 5:59 AM, University of Texas at Arlington<br>
173 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
174 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
175 function delta = del(self)
177 delta = self.toc() - delta;
This is the base class for generating subclass of MATLAB handle superclass whose annoying methods are...
This is the base class for generating objects that can time interval consecutively.
function tic(in self)
Reset the timer, equivalent to reconstructing the timer object. This is a dynamic method of the clas...
function toc(in self)
Return a scalar MATLAB real containing the time past since the (re)construction of the timer object.
function del(in self)
Return a scalar MATLAB real containing the time past since the last time measurement by the timer obj...
function Timer()
Return a scalar object of class pm.timing.Timer.
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...