1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
4 | <title>Struct xtime</title> |
---|
5 | <link rel="stylesheet" href="../boostbook.css" type="text/css"> |
---|
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.68.1"> |
---|
7 | <link rel="start" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> |
---|
8 | <link rel="up" href="../thread/reference.html#header.boost.thread.xtime.hpp" title="Header <boost/thread/xtime.hpp>"> |
---|
9 | <link rel="prev" href="xtime_clock_types.html" title="Type xtime_clock_types"> |
---|
10 | <link rel="next" href="../thread/faq.html" title="Frequently Asked Questions"> |
---|
11 | </head> |
---|
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
---|
13 | <table cellpadding="2" width="100%"> |
---|
14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td> |
---|
15 | <td align="center"><a href="../../../index.htm">Home</a></td> |
---|
16 | <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> |
---|
17 | <td align="center"><a href="../../../people/people.htm">People</a></td> |
---|
18 | <td align="center"><a href="../../../more/faq.htm">FAQ</a></td> |
---|
19 | <td align="center"><a href="../../../more/index.htm">More</a></td> |
---|
20 | </table> |
---|
21 | <hr> |
---|
22 | <div class="spirit-nav"> |
---|
23 | <a accesskey="p" href="xtime_clock_types.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread/reference.html#header.boost.thread.xtime.hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../thread/faq.html"><img src="../images/next.png" alt="Next"></a> |
---|
24 | </div> |
---|
25 | <div class="refentry" lang="en"> |
---|
26 | <a name="boost.xtime"></a><div class="titlepage"></div> |
---|
27 | <div class="refnamediv"> |
---|
28 | <h2><span class="refentrytitle">Struct xtime</span></h2> |
---|
29 | <p>boost::xtime — <p>An object of type <a href="xtime.html" title="Struct xtime">xtime</a> |
---|
30 | defines a time that is used to perform high-resolution time operations. |
---|
31 | This is a temporary solution that will be replaced by a more robust time |
---|
32 | library once available in Boost.</p></p> |
---|
33 | </div> |
---|
34 | <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> |
---|
35 | <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"> |
---|
36 | <span class="bold"><strong>struct</strong></span> xtime { |
---|
37 | |
---|
38 | <span class="emphasis"><em>platform-specific-type</em></span> sec; |
---|
39 | }; |
---|
40 | |
---|
41 | <span class="emphasis"><em>// <a href="xtime.html#id891366-bb">creation</a></em></span> |
---|
42 | <span class="type"><span class="bold"><strong>int</strong></span></span> <a href="xtime.html#boost.xtime_get">xtime_get</a>(<a href="xtime.html" title="Struct xtime">xtime</a>*, <span class="bold"><strong>int</strong></span>);</pre></div> |
---|
43 | <div class="refsect1" lang="en"> |
---|
44 | <a name="id1746533"></a><h2>Description</h2> |
---|
45 | <p>The <a href="xtime.html" title="Struct xtime">xtime</a> type is used to represent a point on |
---|
46 | some time scale or a duration in time. This type may be proposed for the C standard by |
---|
47 | Markus Kuhn. <span class="bold"><strong>Boost.Thread</strong></span> provides only a very minimal implementation of this |
---|
48 | proposal; it is expected that a full implementation (or some other time |
---|
49 | library) will be provided in Boost as a separate library, at which time <span class="bold"><strong>Boost.Thread</strong></span> |
---|
50 | will deprecate its own implementation.</p> |
---|
51 | <p><span class="bold"><strong>Note</strong></span> that the resolution is |
---|
52 | implementation specific. For many implementations the best resolution |
---|
53 | of time is far more than one nanosecond, and even when the resolution |
---|
54 | is reasonably good, the latency of a call to <code class="computeroutput">xtime_get()</code> |
---|
55 | may be significant. For maximum portability, avoid durations of less than |
---|
56 | one second.</p> |
---|
57 | <div class="refsect2" lang="en"> |
---|
58 | <a name="id1746584"></a><h3> |
---|
59 | <a name="id891366-bb"></a><code class="computeroutput">xtime</code> creation</h3> |
---|
60 | <div class="orderedlist"><ol type="1"><li> |
---|
61 | <pre class="literallayout"><span class="type"><span class="bold"><strong>int</strong></span></span> <a name="boost.xtime_get"></a>xtime_get(<a href="xtime.html" title="Struct xtime">xtime</a>* xtp, <span class="bold"><strong>int</strong></span> clock_type);</pre> |
---|
62 | <div class="variablelist"><table border="0"> |
---|
63 | <col align="left" valign="top"> |
---|
64 | <tbody> |
---|
65 | <tr> |
---|
66 | <td> |
---|
67 | <span class="term">Postconditions:</span></td> |
---|
68 | <td> |
---|
69 | <code class="computeroutput">xtp</code> represents the current point in |
---|
70 | time as a duration since the epoch specified by |
---|
71 | <code class="computeroutput">clock_type</code>.</td> |
---|
72 | </tr> |
---|
73 | <tr> |
---|
74 | <td> |
---|
75 | <span class="term">Returns:</span></td> |
---|
76 | <td> |
---|
77 | <code class="computeroutput">clock_type</code> if successful, otherwise 0.</td> |
---|
78 | </tr> |
---|
79 | </tbody> |
---|
80 | </table></div> |
---|
81 | </li></ol></div> |
---|
82 | </div> |
---|
83 | </div> |
---|
84 | </div> |
---|
85 | <table width="100%"><tr> |
---|
86 | <td align="left"></td> |
---|
87 | <td align="right"><small>Copyright © 2001-2003 William E. Kempf</small></td> |
---|
88 | </tr></table> |
---|
89 | <hr> |
---|
90 | <div class="spirit-nav"> |
---|
91 | <a accesskey="p" href="xtime_clock_types.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread/reference.html#header.boost.thread.xtime.hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../thread/faq.html"><img src="../images/next.png" alt="Next"></a> |
---|
92 | </div> |
---|
93 | </body> |
---|
94 | </html> |
---|