1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
3 | <title>mixpp: timing.h Source File</title> |
---|
4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
8 | <script type="text/javascript"> |
---|
9 | <!-- |
---|
10 | function changeDisplayState (e){ |
---|
11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
12 | var button=this.firstChild; |
---|
13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
15 | sectionDiv.style.display='block'; |
---|
16 | button.src='open.gif'; |
---|
17 | }else{ |
---|
18 | sectionDiv.style.display='none'; |
---|
19 | button.src='closed.gif'; |
---|
20 | } |
---|
21 | } |
---|
22 | function initDynSections(){ |
---|
23 | var divs=document.getElementsByTagName('div'); |
---|
24 | var sectionCounter=1; |
---|
25 | for(var i=0;i<divs.length-1;i++){ |
---|
26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
27 | var header=divs[i]; |
---|
28 | var section=divs[i+1]; |
---|
29 | var button=header.firstChild; |
---|
30 | if (button!='IMG'){ |
---|
31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
32 | button=document.createElement('img'); |
---|
33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
34 | } |
---|
35 | header.style.cursor='pointer'; |
---|
36 | header.onclick=changeDisplayState; |
---|
37 | header.id='dynheader'+sectionCounter; |
---|
38 | button.src='closed.gif'; |
---|
39 | section.id='dynsection'+sectionCounter; |
---|
40 | section.style.display='none'; |
---|
41 | section.style.marginLeft='14px'; |
---|
42 | sectionCounter++; |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
46 | window.onload = initDynSections; |
---|
47 | --> |
---|
48 | </script> |
---|
49 | <div class="navigation" id="top"> |
---|
50 | <div class="tabs"> |
---|
51 | <ul> |
---|
52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
55 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
56 | <li class="current"><a href="files.html"><span>Files</span></a></li> |
---|
57 | </ul> |
---|
58 | </div> |
---|
59 | <div class="tabs"> |
---|
60 | <ul> |
---|
61 | <li><a href="files.html"><span>File List</span></a></li> |
---|
62 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
63 | </ul> |
---|
64 | </div> |
---|
65 | <h1>timing.h</h1><a href="timing_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 |
---|
66 | <a name="l00029"></a>00029 <span class="preprocessor">#ifndef TIMING_H</span> |
---|
67 | <a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define TIMING_H</span> |
---|
68 | <a name="l00031"></a>00031 <span class="preprocessor"></span> |
---|
69 | <a name="l00032"></a>00032 |
---|
70 | <a name="l00033"></a>00033 <span class="keyword">namespace </span>itpp |
---|
71 | <a name="l00034"></a>00034 { |
---|
72 | <a name="l00035"></a>00035 |
---|
73 | <a name="l00044"></a><a class="code" href="classitpp_1_1Timer.html">00044</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1Timer.html" title="A virtual base class for timers.">Timer</a> |
---|
74 | <a name="l00045"></a>00045 { |
---|
75 | <a name="l00046"></a>00046 <span class="keyword">public</span>: |
---|
76 | <a name="l00048"></a>00048 <a class="code" href="classitpp_1_1Timer.html#ae6ad7a10add69eb4ddf9873a502889e" title="Create a new timer. Sets the time to zero.">Timer</a>(); |
---|
77 | <a name="l00050"></a><a class="code" href="classitpp_1_1Timer.html#2772d9114f2414687bc199853d2b4a87">00050</a> <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1Timer.html#2772d9114f2414687bc199853d2b4a87" title="Virtual destructor.">~Timer</a>() { } |
---|
78 | <a name="l00052"></a>00052 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Timer.html#430e4c8420c4acfd4c2b9cff842b0878" title="Start the timer. This does not set the time to zero.">start</a>(<span class="keywordtype">void</span>); |
---|
79 | <a name="l00054"></a>00054 <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1Timer.html#e1793d23cbce8d1bd3497885da051e6f" title="Stop the timer. Returns the elapsed time in seconds.">stop</a>(<span class="keywordtype">void</span>); |
---|
80 | <a name="l00056"></a>00056 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Timer.html#cafdc07fe9e863c5ed9093224511ab8d" title="Sets the time to time t, which is zero by default. Stops the timer if it is running...">reset</a>(<span class="keywordtype">double</span> t = 0.0); |
---|
81 | <a name="l00058"></a>00058 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Timer.html#feed20347c7ba104cbddb62e76340bc7" title="Resets the timer and starts it.">tic</a>(<span class="keywordtype">void</span>); |
---|
82 | <a name="l00060"></a>00060 <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1Timer.html#f19c4b9b6728cfa32e8e0492d1f54acb" title="Returns the elapsed time since last tic().">toc</a>(<span class="keywordtype">void</span>); |
---|
83 | <a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Timer.html#dc264ac0276f798f33d229e17c66f8a5" title="Prints the elapsed time since last tic().">toc_print</a>(<span class="keywordtype">void</span>); |
---|
84 | <a name="l00064"></a>00064 <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1Timer.html#53aa5979d6ac8959d9443c1603de74bf" title="Returns the elapsed time.">get_time</a>() <span class="keyword">const</span>; |
---|
85 | <a name="l00065"></a>00065 |
---|
86 | <a name="l00066"></a>00066 <span class="keyword">protected</span>: |
---|
87 | <a name="l00068"></a>00068 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1Timer.html#b91319f9cbad27183546dd59162a10cc" title="Vitrual function that returns teh current time.">get_current_time</a>() <span class="keyword">const</span> = 0; |
---|
88 | <a name="l00070"></a><a class="code" href="classitpp_1_1Timer.html#0d907992dcce3e43494e26ee5f8881cb">00070</a> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1Timer.html#0d907992dcce3e43494e26ee5f8881cb" title="The start time of the timer.">start_time</a>; |
---|
89 | <a name="l00072"></a><a class="code" href="classitpp_1_1Timer.html#e652cc2d3a428fc989dbfd30cfef62d9">00072</a> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1Timer.html#e652cc2d3a428fc989dbfd30cfef62d9" title="The stop time of the timer.">stop_time</a>; |
---|
90 | <a name="l00074"></a><a class="code" href="classitpp_1_1Timer.html#adcc1d37966cefe6150b5ebc55f44d7c">00074</a> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1Timer.html#adcc1d37966cefe6150b5ebc55f44d7c" title="The ellapsed time from start to stop.">elapsed_time</a>; |
---|
91 | <a name="l00076"></a><a class="code" href="classitpp_1_1Timer.html#aa44f4c306bea316f974e7f0a1f3c096">00076</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1Timer.html#aa44f4c306bea316f974e7f0a1f3c096" title="A bool that indicates if the timer is running or not.">running</a>; |
---|
92 | <a name="l00077"></a>00077 }; |
---|
93 | <a name="l00078"></a>00078 |
---|
94 | <a name="l00103"></a><a class="code" href="classitpp_1_1CPU__Timer.html">00103</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1CPU__Timer.html" title="A CPU time timer classMeasures the time spent by the CPU on the current process....">CPU_Timer</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1Timer.html" title="A virtual base class for timers.">Timer</a> |
---|
95 | <a name="l00104"></a>00104 { |
---|
96 | <a name="l00105"></a>00105 <span class="keyword">public</span>: |
---|
97 | <a name="l00107"></a><a class="code" href="classitpp_1_1CPU__Timer.html#ee777faea591a3b98df411542b64d395">00107</a> <a class="code" href="classitpp_1_1CPU__Timer.html#ee777faea591a3b98df411542b64d395" title="Create a new timer. Sets the time to zero.">CPU_Timer</a>() { } |
---|
98 | <a name="l00108"></a>00108 |
---|
99 | <a name="l00109"></a>00109 <span class="keyword">protected</span>: |
---|
100 | <a name="l00111"></a>00111 <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1CPU__Timer.html#20bf24b632b5f049762c62b5ef57658d" title="Vitrual function that returns teh current time.">get_current_time</a>() <span class="keyword">const</span>; |
---|
101 | <a name="l00112"></a>00112 }; |
---|
102 | <a name="l00113"></a>00113 |
---|
103 | <a name="l00137"></a><a class="code" href="classitpp_1_1Real__Timer.html">00137</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1Real__Timer.html" title="A real time timer classMeasures real time.">Real_Timer</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1Timer.html" title="A virtual base class for timers.">Timer</a> |
---|
104 | <a name="l00138"></a>00138 { |
---|
105 | <a name="l00139"></a>00139 <span class="keyword">public</span>: |
---|
106 | <a name="l00141"></a><a class="code" href="classitpp_1_1Real__Timer.html#b8f75b7ed51151fda9861ffa7dbe188b">00141</a> <a class="code" href="classitpp_1_1Real__Timer.html#b8f75b7ed51151fda9861ffa7dbe188b" title="Create a new timer. Sets the time to zero.">Real_Timer</a>() { } |
---|
107 | <a name="l00142"></a>00142 |
---|
108 | <a name="l00143"></a>00143 <span class="keyword">protected</span>: |
---|
109 | <a name="l00145"></a>00145 <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1Real__Timer.html#196ab771433a2cc17ed190a81e1d39ac" title="Vitrual function that returns teh current time.">get_current_time</a>() <span class="keyword">const</span>; |
---|
110 | <a name="l00146"></a>00146 }; |
---|
111 | <a name="l00147"></a>00147 |
---|
112 | <a name="l00152"></a>00152 <span class="keywordtype">void</span> <a class="code" href="group__timers.html#g4c1fa2a92a7d4e69002c91dfe0c41483" title="Reset and start timer.">tic</a>(); |
---|
113 | <a name="l00153"></a>00153 |
---|
114 | <a name="l00158"></a>00158 <span class="keywordtype">double</span> <a class="code" href="group__timers.html#gbff8c6df34e4a24154d05bd64e1afc4f" title="Returns the elapsed time since last tic().">toc</a>(); |
---|
115 | <a name="l00159"></a>00159 |
---|
116 | <a name="l00164"></a>00164 <span class="keywordtype">void</span> <a class="code" href="group__timers.html#gb764b6e7f306577aeec8909ee818748c" title="Prints the elapsed time since last tic().">toc_print</a>(); |
---|
117 | <a name="l00165"></a>00165 |
---|
118 | <a name="l00174"></a>00174 <span class="keywordtype">void</span> <a class="code" href="group__timers.html#g5a01025d79b50aed2c516aa5206ef436" title="pause">pause</a>(<span class="keywordtype">double</span> t = -1); |
---|
119 | <a name="l00175"></a>00175 |
---|
120 | <a name="l00176"></a>00176 } <span class="comment">// namespace itpp</span> |
---|
121 | <a name="l00177"></a>00177 |
---|
122 | <a name="l00178"></a>00178 <span class="preprocessor">#endif // #ifndef TIMING_H</span> |
---|
123 | </pre></div></div> |
---|
124 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:13 2009 for mixpp by |
---|
125 | <a href="http://www.doxygen.org/index.html"> |
---|
126 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
127 | </body> |
---|
128 | </html> |
---|