<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>C++ API frePPLe: frepple::utils::Timer Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="../styles.css" rel="stylesheet" type="text/css"> </head> <body> <div id="container"> <div id="menubar"> <div id="logo" align="center"> <br/><img src='../frepple.bmp' alt="frepple" /><br/> <a href='http://www.frepple.com/'> <strong>a Free<br/>Production Planning<br/>Library</strong> </a> </div> <div id="menu"> <br/> <h3><a href='../Main/HomePage.html'>Main</a></h3> <h3><a href='../UI/Main.html'>User Manual</a></h3> <h3><a href='../Tutorial/Main.html'>Tutorial</a></h3> <h3><a href='../Frepple/Main.html'>Reference Manual</a></h3> <h3><a href='../Main/FAQ.html'>FAQ</a></h3> <h3><a href='index.html'>C++ API</a></h3> <br/> </div> </div> <div id="content"> <br/> <!-- Generated by Doxygen 1.6.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="a00256.html">frepple</a>::<a class="el" href="a00257.html">utils</a>::<a class="el" href="a00180.html">Timer</a> </div> </div> <div class="contents"> <h1>frepple::utils::Timer Class Reference</h1><!-- doxytag: class="frepple::utils::Timer" --> <p>This class is used to measure the processor time used by the program. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="a00252_source.html">utils.h</a>></code></p> <p><a href="a00645.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="a00180.html#a4d80c7c54d18573865eb925f912499f9">elapsed</a> () const </td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00180.html#ab304f48213c1a13931582ad2a63844d6">restart</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00180.html#a72efe61f6b37f51d4419e398f73487c8">Timer</a> ()</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>This class is used to measure the processor time used by the program. </p> <p>The accuracy of the timer is dependent on the implementation of the ANSI C-function clock() by your compiler and your platform. You may count on milli-second accuracy. Different platforms provide more accurate timer functions, which can be used if the accuracy is a prime objective.<br/> When compiled with Visual C++, the timer is returning the elapsed time - which is not the expected ANSI behavior!<br/> Other compilers and platforms return the consumed cpu time, as expected. When the load on a machine is low, the consumed cpu-time and the elapsed time are close to each other. On a system with a higher load, the elapsed time deviates a lot from the consumed cpu-time. </p> <p>Definition at line <a class="el" href="a00252_source.html#l01589">1589</a> of file <a class="el" href="a00252_source.html">utils.h</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a72efe61f6b37f51d4419e398f73487c8"></a><!-- doxytag: member="frepple::utils::Timer::Timer" ref="a72efe61f6b37f51d4419e398f73487c8" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">frepple::utils::Timer::Timer </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline, explicit]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Default constructor. Creating the timer object sets the start point for the time measurement. </p> <p>Definition at line <a class="el" href="a00252_source.html#l01594">1594</a> of file <a class="el" href="a00252_source.html">utils.h</a>.</p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a4d80c7c54d18573865eb925f912499f9"></a><!-- doxytag: member="frepple::utils::Timer::elapsed" ref="a4d80c7c54d18573865eb925f912499f9" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double frepple::utils::Timer::elapsed </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return the cpu-time in seconds consumed since the creation or the last reset of the timer. </p> <p>Definition at line <a class="el" href="a00252_source.html#l01601">1601</a> of file <a class="el" href="a00252_source.html">utils.h</a>.</p> </div> </div> <a class="anchor" id="ab304f48213c1a13931582ad2a63844d6"></a><!-- doxytag: member="frepple::utils::Timer::restart" ref="ab304f48213c1a13931582ad2a63844d6" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void frepple::utils::Timer::restart </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Reset the time counter to 0. </p> <p>Definition at line <a class="el" href="a00252_source.html#l01597">1597</a> of file <a class="el" href="a00252_source.html">utils.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="a00252_source.html">utils.h</a></li> </ul> </div> <hr size="1"/><address style="align: right;"><small>Documentation generated for frePPLe by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"/></a></small></address> </div> </div> </body> </html>