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>
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 %> The scalar MATLAB real containing the timer start.<br>
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 methods(Access =
public)
60 %> Return a scalar
object of
class [pm.timing.Timer](@ref
Timer).<br>
63 %> This is the constructor of the
class [pm.timing.Timer](@ref
Timer).<br>
66 %> ``self`` : The output scalar
object of
class [pm.timing.Timer](@ref
Timer).<br>
71 %> self = pm.timing.
Timer()
76 %> \include{lineno} example/timing/
Timer/main.m
78 %> \include{lineno} example/timing/
Timer/main.out.m
83 %> \JoshuaOsborne, May 21 2024, 5:49 AM, University of Texas at Arlington<br>
84 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
85 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
86 function self =
Timer()
91 %> Reset the timer, equivalent to reconstructing the timer
object.<br>
92 %> This is a dynamic method of the class [pm.timing.
Timer](@ref
Timer).
97 %> timer = pm.timing.
Timer()
105 %> \JoshuaOsborne, May 21 2024, 5:50 AM, University of Texas at Arlington<br>
106 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
107 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
114 %> Return a scalar MATLAB ``real`` containing the time
115 %> past since the (re)construction of the timer
object.<br>
118 %> Also, set the ``clock`` attribute of the parent
object.<br>
119 %> This is a dynamic method of the
class [pm.timing.Timer](@ref
Timer).<br>
122 %> ``clock`` : The output scalar MATLAB ``real`` containing the time
123 %> past since the (re)construction of the timer
object.<br>
128 %> timer = pm.timing.Timer()
129 %> clock = timer.toc()
136 %> \JoshuaOsborne, May 21 2024, 5:58 AM, University of Texas at Arlington<br>
137 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
138 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
139 function clock = toc(self)
140 self.clock = toc(self.start);
145 %> Return a scalar MATLAB ``real`` containing the time past
146 %> since the last time measurement by the timer
object.<br>
147 %> Also, set the ``clock`` attribute of the parent
object.<br>
148 %> This is a dynamic method of the
class [pm.timing.Timer](@ref
Timer).<br>
151 %> ``delta`` : The output scalar MATLAB ``real`` containing the time
152 %> past since the last time measurement by the timer
object.<br>
157 %> timer = pm.timing.Timer()
158 %> delta = timer.del()
164 %> \JoshuaOsborne, May 21 2024, 5:59 AM, University of Texas at Arlington<br>
165 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
166 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
167 function delta = del(self)
169 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...