...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
|
Boost.ThreadsHeader <boost/thread/xtime.hpp> |
xtime
xtime
synopsisxtime_get
The header <boost/thread/xtime.hpp> defines functions and data types used to perform high-resolution time operations. This is a temporary solution that will be replaced by a more robust time library once available in Boost.
enum { TIME_UTC }
The clock type for Coordinated Universal Time (UTC). The epoch for this clock type is 1970-01-01 00:00:00. This is the only clock type supported by Boost.Threads.
xtime
The xtime
type is used to represent a point on some time scale
or a duration in time. This type may be proposed for the C standard by Markus
Kuhn. Boost.Threads provides only a very minimal implementation of this
proposal and it's expected that a full implementation (or some other time
library) will be provided in Boost as a separate library, at which time Boost.Threads
will deprecate its implementation.
xtime
synopsisnamespace boost { struct xtime { #if defined(BOOST_NO_INT64_T) int_fast32_t sec; #else int_fast64_t sec; #endif int_fast32_t nsec; }; };
int xtime_get(struct xtime* xtp, int clock_type);
xtp
represents the current point in
time as a duration since the epoch specified by the clock_type
.clock_type
if successful, otherwise 0.xtime_get()
may be significant. For maximum portability, avoid durations of less than
one second.Revised 05 November, 2001
© Copyright William E. Kempf 2001-2002. All Rights Reserved.
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. William E. Kempf makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.