Changeset 538 for library/doc/html/timer.html
- Timestamp:
- 08/16/09 18:14:04 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/doc/html/timer.html
r472 r538 5 5 <link href="doxygen.css" rel="stylesheet" type="text/css"> 6 6 </head><body> 7 <!-- Generated by Doxygen 1.5. 9-->7 <!-- Generated by Doxygen 1.5.8 --> 8 8 <script type="text/javascript"> 9 9 <!-- … … 69 69 <span class="keyword">using</span> std::endl; 70 70 71 <span class="keywordtype">int</span> main() 72 { 73 <span class="comment">//Declare the scalars used:</span> 74 <span class="keywordtype">long</span> i, sum, N; 71 <span class="keywordtype">int</span> main() { 72 <span class="comment">//Declare the scalars used:</span> 73 <span class="keywordtype">long</span> i, sum, N; 75 74 76 <span class="comment">//Declare tt as an instance of the timer class:</span>77 Real_Timer tt;75 <span class="comment">//Declare tt as an instance of the timer class:</span> 76 Real_Timer tt; 78 77 79 <span class="comment">//Initiate the variables:</span>80 N = 1000000;81 sum = 0;78 <span class="comment">//Initiate the variables:</span> 79 N = 1000000; 80 sum = 0; 82 81 83 <span class="comment">//Start and reset the timer:</span>84 tt.tic();82 <span class="comment">//Start and reset the timer:</span> 83 tt.tic(); 85 84 86 <span class="comment">//Do some processing</span>87 <span class="keywordflow">for</span> (i = 0; i < N; i++) {88 sum += i;89 }85 <span class="comment">//Do some processing</span> 86 <span class="keywordflow">for</span> ( i = 0; i < N; i++ ) { 87 sum += i; 88 } 90 89 91 <span class="comment">// Print the elapsed time</span>92 tt.toc_print();90 <span class="comment">// Print the elapsed time</span> 91 tt.toc_print(); 93 92 94 <span class="comment">//Print the result of the processing:</span>95 cout << <span class="stringliteral">"The sum of all integers from 0 to "</span> << N - 1 << <span class="stringliteral">" equals "</span> << sum << endl;93 <span class="comment">//Print the result of the processing:</span> 94 cout << <span class="stringliteral">"The sum of all integers from 0 to "</span> << N - 1 << <span class="stringliteral">" equals "</span> << sum << endl; 96 95 97 <span class="comment">//Exit program:</span>98 <span class="keywordflow">return</span> 0;96 <span class="comment">//Exit program:</span> 97 <span class="keywordflow">return</span> 0; 99 98 100 99 } … … 104 103 The sum of all integers from 0 to 999999 equals 1783293664 105 104 </pre></div> </div> 106 <hr size="1"><address style="text-align: right;"><small>Generated on Wed Aug 5 00:06:512009 for mixpp by 105 <hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 16 17:58:18 2009 for mixpp by 107 106 <a href="http://www.doxygen.org/index.html"> 108 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5. 9</small></address>107 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> 109 108 </body> 110 109 </html>