Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/thread/xtime.hpp @ 44

Last change on this file since 44 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.2 KB
Line 
1// Copyright (C) 2001-2003
2// William E. Kempf
3//
4//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7#ifndef BOOST_XTIME_WEK070601_HPP
8#define BOOST_XTIME_WEK070601_HPP
9
10#include <boost/thread/detail/config.hpp>
11
12#include <boost/cstdint.hpp>
13
14namespace boost {
15
16enum xtime_clock_types
17{
18    TIME_UTC=1
19//    TIME_TAI,
20//    TIME_MONOTONIC,
21//    TIME_PROCESS,
22//    TIME_THREAD,
23//    TIME_LOCAL,
24//    TIME_SYNC,
25//    TIME_RESOLUTION
26};
27
28struct xtime
29{
30#if defined(BOOST_NO_INT64_T)
31    typedef int_fast32_t xtime_sec_t; //INT_FAST32_MIN <= sec <= INT_FAST32_MAX
32#else
33    typedef int_fast64_t xtime_sec_t; //INT_FAST64_MIN <= sec <= INT_FAST64_MAX
34#endif
35
36    typedef int_fast32_t xtime_nsec_t; //0 <= xtime.nsec < NANOSECONDS_PER_SECOND
37
38    xtime_sec_t sec;
39    xtime_nsec_t nsec;
40};
41
42int BOOST_THREAD_DECL xtime_get(struct xtime* xtp, int clock_type);
43
44inline int xtime_cmp(const xtime& xt1, const xtime& xt2)
45{
46    if (xt1.sec == xt2.sec)
47        return (int)(xt1.nsec - xt2.nsec);
48    else 
49        return (xt1.sec > xt2.sec) ? 1 : -1;
50}
51
52} // namespace boost
53
54#endif //BOOST_XTIME_WEK070601_HPP
Note: See TracBrowser for help on using the repository browser.