📄 classtiming.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Timing class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.2.12 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>Timing Class Reference</h1><code>#include <<a class="el" href="Logger_8h-source.html">Logger.h</a>></code><p><a href="classTiming-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classTiming.html#a0">printTimeDiffWithText</a> (ostream &os, char *str, int iFactor=1000)</td></tr><tr><td nowrap align=right valign=top>double </td><td valign=bottom><a class="el" href="classTiming.html#a1">getElapsedTime</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classTiming.html#a2">restartTime</a> ()</td></tr><tr><td colspan=2><br><h2>Static Public Methods</h2></td></tr><tr><td nowrap align=right valign=top>double </td><td valign=bottom><a class="el" href="classTiming.html#d0">getTimeDifference</a> (struct timeval t1, struct timeval t2)</td></tr><tr><td colspan=2><br><h2>Private Attributes</h2></td></tr><tr><td nowrap align=right valign=top>timeval </td><td valign=bottom><a class="el" href="classTiming.html#o0">time1</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class holds a timer. This timer can be set (restartTime) and text can be printed with the elapsed time since the timer was restarted.. <p><p>Definition at line <a class="el" href="Logger_8h-source.html#l00062">62</a> of file <a class="el" href="Logger_8h-source.html">Logger.h</a>.<hr><h2>Member Function Documentation</h2><a name="a1" doxytag="Timing::getElapsedTime"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> double Timing::getElapsedTime </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This method returns the time (in seconds) since the last time the timer was restarted. <dl compact><dt><b>Returns: </b><dd>double seconds that have passed since last restart of timer </dl><p>Definition at line <a class="el" href="Logger_8C-source.html#l00302">302</a> of file <a class="el" href="Logger_8C-source.html">Logger.C</a>.<p>References <a class="el" href="Logger_8C-source.html#l00280">getTimeDifference</a>(), and <a class="el" href="Logger_8h-source.html#l00064">time1</a>.<p>Referenced by <a class="el" href="Logger_8C-source.html#l00293">printTimeDiffWithText</a>(). </td> </tr></table><a name="d0" doxytag="Timing::getTimeDifference"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> double Timing::getTimeDifference </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">struct timeval </td> <td class="mdname" nowrap> <em>tv1</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>struct timeval </td> <td class="mdname" nowrap> <em>tv2</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This method returns the difference between two timevals in seconds. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>tv1</em> </td><td>first timeval </td></tr><tr><td valign=top><em>tv2</em> </td><td>second timeval </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>double representing the difference between t1 and t2 in seconds </dl><p>Definition at line <a class="el" href="Logger_8C-source.html#l00280">280</a> of file <a class="el" href="Logger_8C-source.html">Logger.C</a>.<p>Referenced by <a class="el" href="Logger_8C-source.html#l00302">getElapsedTime</a>(). </td> </tr></table><a name="a0" doxytag="Timing::printTimeDiffWithText"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Timing::printTimeDiffWithText </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">ostream & </td> <td class="mdname" nowrap> <em>os</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>str</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>iFactor</em> = 1000</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This method prints the time in seconds that elapsed since the timer was restarted. It is possible to multiply this time with a factor, such that it can be used for different purposes. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>os</em> </td><td>output stream to which output should be written. </td></tr><tr><td valign=top><em>str</em> </td><td>that should be printed </td></tr><tr><td valign=top><em>iFactor</em> </td><td>with which the elapsed time is multiplied (default 1000) </td></tr></table></dl><p>Definition at line <a class="el" href="Logger_8C-source.html#l00293">293</a> of file <a class="el" href="Logger_8C-source.html">Logger.C</a>.<p>References <a class="el" href="Logger_8C-source.html#l00302">getElapsedTime</a>().<p>Referenced by <a class="el" href="Logger_8C-source.html#l00134">Logger::logWithTime</a>(). </td> </tr></table><a name="a2" doxytag="Timing::restartTime"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Timing::restartTime </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This method restarts the timer by setting it to the current time <p>Definition at line <a class="el" href="Logger_8C-source.html#l00310">310</a> of file <a class="el" href="Logger_8C-source.html">Logger.C</a>.<p>References <a class="el" href="Logger_8h-source.html#l00064">time1</a>.<p>Referenced by <a class="el" href="Logger_8C-source.html#l00066">Logger::Logger</a>(), and <a class="el" href="Logger_8C-source.html#l00159">Logger::restartTimer</a>(). </td> </tr></table><hr><h2>Member Data Documentation</h2><a name="o0" doxytag="Timing::time1"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> struct timeval Timing::time1<code> [private]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><a class="el" href="classTime.html">Time</a> the timer has last been restarted. <p>Definition at line <a class="el" href="Logger_8h-source.html#l00064">64</a> of file <a class="el" href="Logger_8h-source.html">Logger.h</a>.<p>Referenced by <a class="el" href="Logger_8C-source.html#l00302">getElapsedTime</a>(), and <a class="el" href="Logger_8C-source.html#l00310">restartTime</a>(). </td> </tr></table><hr>The documentation for this class was generated from the following files:<ul><li><a class="el" href="Logger_8h-source.html">Logger.h</a><li><a class="el" href="Logger_8C-source.html">Logger.C</a></ul><hr><address><small>Generated on Thu Mar 7 00:37:58 2002 for UvA Trilearn 2001 by<a href="http://www.doxygen.org/index.html"><img src="doxygen.gif" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.12 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2001</small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -