blob: a26218ab76a951f3ac1173cfb9b1a6bc0cf92dce [file]
<html lang="en">
<head>
<title>clock - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Timefns.html#Timefns" title="Timefns">
<link rel="prev" href="asctime.html#asctime" title="asctime">
<link rel="next" href="ctime.html#ctime" title="ctime">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="clock"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="ctime.html#ctime">ctime</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="asctime.html#asctime">asctime</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Timefns.html#Timefns">Timefns</a>
<hr>
</div>
<h3 class="section">8.2 <code>clock</code>&mdash;cumulative processor time</h3>
<p><a name="index-clock-430"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;time.h&gt;
clock_t clock(void);
</pre>
<p><strong>Description</strong><br>
Calculates the best available approximation of the cumulative amount
of time used by your program since it started. To convert the result
into seconds, divide by the macro <code>CLOCKS_PER_SEC</code>.
<p><br>
<strong>Returns</strong><br>
The amount of processor time used so far by your program, in units
defined by the machine-dependent macro <code>CLOCKS_PER_SEC</code>. If no
measurement is available, the result is (clock_t)<code>-1</code>.
<p><br>
<strong>Portability</strong><br>
ANSI C requires <code>clock</code> and <code>CLOCKS_PER_SEC</code>.
<p>Supporting OS subroutine required: <code>times</code>.
<p><br>
</body></html>