| 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.69.1"> |
|---|
| 7 | <link rel="start" href="index.html" title="The Boost C++ Libraries"> |
|---|
| 8 | <link rel="up" href="threads/reference.html#id2416096" title="Header <boost/thread/xtime.hpp>"> |
|---|
| 9 | <link rel="prev" href="id2545607.html" title="Type xtime_clock_types"> |
|---|
| 10 | <link rel="next" href="threads/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.png (6897 bytes)" 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="id2545607.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="threads/reference.html#id2416096"><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="threads/faq.html"><img src="images/next.png" alt="Next"></a> |
|---|
| 24 | </div> |
|---|
| 25 | <div class="refentry" lang="en"> |
|---|
| 26 | <a name="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#id2583643-bb">creation</a></em></span> |
|---|
| 42 | <span class="type"><span class="bold"><strong>int</strong></span></span> <a href="xtime.html#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="id2786430"></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.Threads</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.Threads</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="id2786479"></a><h3> |
|---|
| 59 | <a name="id2583643-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="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 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Postconditions</span></b>: |
|---|
| 63 | |
|---|
| 64 | <code class="computeroutput">xtp</code> represents the current point in |
|---|
| 65 | time as a duration since the epoch specified by |
|---|
| 66 | <code class="computeroutput">clock_type</code>.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
|---|
| 67 | |
|---|
| 68 | <code class="computeroutput">clock_type</code> if successful, otherwise 0.</p> |
|---|
| 69 | </li></ol></div> |
|---|
| 70 | </div> |
|---|
| 71 | </div> |
|---|
| 72 | </div> |
|---|
| 73 | <table width="100%"><tr> |
|---|
| 74 | <td align="left"></td> |
|---|
| 75 | <td align="right"><small>Copyright © 2001-2003 William E. Kempf</small></td> |
|---|
| 76 | </tr></table> |
|---|
| 77 | <hr> |
|---|
| 78 | <div class="spirit-nav"> |
|---|
| 79 | <a accesskey="p" href="id2545607.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="threads/reference.html#id2416096"><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="threads/faq.html"><img src="images/next.png" alt="Next"></a> |
|---|
| 80 | </div> |
|---|
| 81 | </body> |
|---|
| 82 | </html> |
|---|