1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Chrono</title> 5<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../boost_asio.html" title="Boost.Asio"> 8<link rel="up" href="../cpp2011.html" title="C++ 2011 Support"> 9<link rel="prev" href="shared_ptr.html" title="Shared Pointers"> 10<link rel="next" href="futures.html" title="Futures"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="shared_ptr.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../cpp2011.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="futures.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h4 class="title"> 27<a name="boost_asio.overview.cpp2011.chrono"></a><a class="link" href="chrono.html" title="Chrono">Chrono</a> 28</h4></div></div></div> 29<p> 30 Boost.Asio provides timers based on the <code class="computeroutput">std::chrono</code> facilities 31 via the <a class="link" href="../../reference/basic_waitable_timer.html" title="basic_waitable_timer">basic_waitable_timer</a> 32 class template. The typedefs <a class="link" href="../../reference/system_timer.html" title="system_timer">system_timer</a>, 33 <a class="link" href="../../reference/steady_timer.html" title="steady_timer">steady_timer</a> and 34 <a class="link" href="../../reference/high_resolution_timer.html" title="high_resolution_timer">high_resolution_timer</a> 35 utilise the standard clocks <code class="computeroutput">system_clock</code>, <code class="computeroutput">steady_clock</code> 36 and <code class="computeroutput">high_resolution_clock</code> respectively. 37 </p> 38<p> 39 Support for the <code class="computeroutput">std::chrono</code> facilities is automatically enabled 40 for <code class="literal">g++</code> 4.6 and later, when the <code class="literal">-std=c++0x</code> 41 or <code class="literal">-std=gnu++0x</code> compiler options are used. (Note that, 42 for <code class="literal">g++</code>, the draft-standard <code class="computeroutput">monotonic_clock</code> 43 is used in place of <code class="computeroutput">steady_clock</code>.) Support may be disabled 44 by defining <code class="computeroutput">BOOST_ASIO_DISABLE_STD_CHRONO</code>, or explicitly enabled 45 for other compilers by defining <code class="computeroutput">BOOST_ASIO_HAS_STD_CHRONO</code>. 46 </p> 47<p> 48 When standard <code class="computeroutput">chrono</code> is unavailable, Boost.Asio will otherwise 49 use the Boost.Chrono library. The <a class="link" href="../../reference/basic_waitable_timer.html" title="basic_waitable_timer">basic_waitable_timer</a> 50 class template may be used with either. 51 </p> 52</div> 53<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 54<td align="left"></td> 55<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 56 Kohlhoff<p> 57 Distributed under the Boost Software License, Version 1.0. (See accompanying 58 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 59 </p> 60</div></td> 61</tr></table> 62<hr> 63<div class="spirit-nav"> 64<a accesskey="p" href="shared_ptr.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../cpp2011.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="futures.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 65</div> 66</body> 67</html> 68