blob: a162b3ea8184bf0652a79daab448dc107dd2df47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<h1 id="firstHeading" class="firstHeading">CLOCKS_PER_SEC</h1> <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code><time.h></code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl"> <td class="t-dcl-nopad"> <pre data-language="c">#define CLOCKS_PER_SEC /*implementation defined*/</pre>
</td> <td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> </table> <p>Expands to an expression (not necessarily a compile-time constant) of type <code><a href="clock_t" title="c/chrono/clock t">clock_t</a></code> equal to the number of clock ticks per second, as returned by <code><a href="clock" title="c/chrono/clock">clock()</a></code>.</p>
<h3 id="Notes"> Notes</h3> <p>POSIX defines <code>CLOCKS_PER_SEC</code> as one million, regardless of the actual precision of <code><a href="clock" title="c/chrono/clock">clock</a></code>.</p>
<p>Until standardized as <code>CLOCKS_PER_SEC</code> in C89, this macro was sometimes known by its IEEE std 1003.1-1988 name <code>CLK_TCK</code>: that name was not included in C89 and was removed from POSIX itself in 1996 over ambiguity with <code>_SC_CLK_TCK</code>, which gives number of clocks per second for the function <a rel="nofollow" class="external text" href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/times.html"><code>times()</code></a>).</p>
<h3 id="References"> References</h3> <ul>
<li> C23 standard (ISO/IEC 9899:2023): </li>
<ul><li> 7.27.1/2 Components of time (p: TBD) </li></ul>
<li> C17 standard (ISO/IEC 9899:2018): </li>
<ul><li> 7.27.1/2 Components of time (p: 284) </li></ul>
<li> C11 standard (ISO/IEC 9899:2011): </li>
<ul><li> 7.27.1/2 Components of time (p: 388) </li></ul>
<li> C99 standard (ISO/IEC 9899:1999): </li>
<ul><li> 7.23.1/2 Components of time (p: 338) </li></ul>
<li> C89/C90 standard (ISO/IEC 9899:1990): </li>
<ul><li> 4.12.1 Components of time </li></ul>
</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="clock" title="c/chrono/clock"> <span class="t-lines"><span>clock</span></span></a></div> </td> <td> returns raw processor clock time since the program is started <br> <span class="t-mark">(function)</span> </td>
</tr> <tr class="t-dsc"> <td> <div><a href="clock_t" title="c/chrono/clock t"> <span class="t-lines"><span>clock_t</span></span></a></div> </td> <td> processor time since era type <br> <span class="t-mark">(typedef)</span> </td>
</tr> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/chrono/c/CLOCKS_PER_SEC" title="cpp/chrono/c/CLOCKS PER SEC">C++ documentation</a></span> for <code>CLOCKS_PER_SEC</code> </td>
</tr> </table> <div class="_attribution">
<p class="_attribution-p">
© cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
<a href="https://en.cppreference.com/w/c/chrono/CLOCKS_PER_SEC" class="_attribution-link">https://en.cppreference.com/w/c/chrono/CLOCKS_PER_SEC</a>
</p>
</div>
|