vectozavr-shooter/SFML-VS32/doc/html/classsf_1_1Clock.html

155 lines
9.3 KiB
HTML
Raw Normal View History

2021-10-09 13:41:12 +03:00
<!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>
<title>SFML - Simple and Fast Multimedia Library</title>
<meta http-equiv="Content-Type" content="text/html;"/>
<meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">SFML 2.5.1</span>
</div>
</div>
<div id="content">
<!-- Generated by Doxygen 1.8.14 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</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>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Clock.html">Clock</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classsf_1_1Clock-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">sf::Clock Class Reference<div class="ingroups"><a class="el" href="group__system.html">System module</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>Utility class that measures the elapsed time.
<a href="classsf_1_1Clock.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Clock_8hpp_source.html">Clock.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abbc959c7830ca7c3a4da133cb506d3fd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Clock.html#abbc959c7830ca7c3a4da133cb506d3fd">Clock</a> ()</td></tr>
<tr class="memdesc:abbc959c7830ca7c3a4da133cb506d3fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#abbc959c7830ca7c3a4da133cb506d3fd">More...</a><br /></td></tr>
<tr class="separator:abbc959c7830ca7c3a4da133cb506d3fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe889b42a65bcd8eefc16419645d08a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Time.html">Time</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Clock.html#abe889b42a65bcd8eefc16419645d08a7">getElapsedTime</a> () const</td></tr>
<tr class="memdesc:abe889b42a65bcd8eefc16419645d08a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the elapsed time. <a href="#abe889b42a65bcd8eefc16419645d08a7">More...</a><br /></td></tr>
<tr class="separator:abe889b42a65bcd8eefc16419645d08a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a123e2627f2943e5ecaa1db0c7df3231b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Time.html">Time</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Clock.html#a123e2627f2943e5ecaa1db0c7df3231b">restart</a> ()</td></tr>
<tr class="memdesc:a123e2627f2943e5ecaa1db0c7df3231b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restart the clock. <a href="#a123e2627f2943e5ecaa1db0c7df3231b">More...</a><br /></td></tr>
<tr class="separator:a123e2627f2943e5ecaa1db0c7df3231b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Utility class that measures the elapsed time. </p>
<p><a class="el" href="classsf_1_1Clock.html" title="Utility class that measures the elapsed time. ">sf::Clock</a> is a lightweight class for measuring time.</p>
<p>Its provides the most precise time that the underlying OS can achieve (generally microseconds or nanoseconds). It also ensures monotonicity, which means that the returned time can never go backward, even if the system time is changed.</p>
<p>Usage example: </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Clock.html">sf::Clock</a> clock;</div><div class="line">...</div><div class="line">Time time1 = clock.<a class="code" href="classsf_1_1Clock.html#abe889b42a65bcd8eefc16419645d08a7">getElapsedTime</a>();</div><div class="line">...</div><div class="line"><a class="code" href="classsf_1_1Time.html#acba0cfbc49e3a09a22a8e079eb67a05c">Time</a> time2 = clock.<a class="code" href="classsf_1_1Clock.html#a123e2627f2943e5ecaa1db0c7df3231b">restart</a>();</div></div><!-- fragment --><p>The <a class="el" href="classsf_1_1Time.html" title="Represents a time value. ">sf::Time</a> value returned by the clock can then be converted to a number of seconds, milliseconds or even microseconds.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Time.html" title="Represents a time value. ">sf::Time</a> </dd></dl>
<p class="definition">Definition at line <a class="el" href="Clock_8hpp_source.html#l00041">41</a> of file <a class="el" href="Clock_8hpp_source.html">Clock.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="abbc959c7830ca7c3a4da133cb506d3fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abbc959c7830ca7c3a4da133cb506d3fd">&#9670;&nbsp;</a></span>Clock()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::Clock::Clock </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
<p>The clock starts automatically after being constructed. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="abe889b42a65bcd8eefc16419645d08a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe889b42a65bcd8eefc16419645d08a7">&#9670;&nbsp;</a></span>getElapsedTime()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Time.html">Time</a> sf::Clock::getElapsedTime </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the elapsed time. </p>
<p>This function returns the time elapsed since the last call to <a class="el" href="classsf_1_1Clock.html#a123e2627f2943e5ecaa1db0c7df3231b" title="Restart the clock. ">restart()</a> (or the construction of the instance if <a class="el" href="classsf_1_1Clock.html#a123e2627f2943e5ecaa1db0c7df3231b" title="Restart the clock. ">restart()</a> has not been called).</p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classsf_1_1Time.html" title="Represents a time value. ">Time</a> elapsed </dd></dl>
</div>
</div>
<a id="a123e2627f2943e5ecaa1db0c7df3231b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a123e2627f2943e5ecaa1db0c7df3231b">&#9670;&nbsp;</a></span>restart()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Time.html">Time</a> sf::Clock::restart </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Restart the clock. </p>
<p>This function puts the time counter back to zero. It also returns the time elapsed since the clock was started.</p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classsf_1_1Time.html" title="Represents a time value. ">Time</a> elapsed </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Clock_8hpp_source.html">Clock.hpp</a></li>
</ul>
</div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
</div>
</div>
</body>
</html>