sl@0: // Copyright (C) 2001-2003 sl@0: // William E. Kempf sl@0: // sl@0: // Distributed under the Boost Software License, Version 1.0. (See accompanying sl@0: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: #ifndef BOOST_XTIME_WEK070601_HPP sl@0: #define BOOST_XTIME_WEK070601_HPP sl@0: sl@0: #include sl@0: sl@0: #include sl@0: sl@0: namespace boost { sl@0: sl@0: enum xtime_clock_types sl@0: { sl@0: TIME_UTC=1 sl@0: // TIME_TAI, sl@0: // TIME_MONOTONIC, sl@0: // TIME_PROCESS, sl@0: // TIME_THREAD, sl@0: // TIME_LOCAL, sl@0: // TIME_SYNC, sl@0: // TIME_RESOLUTION sl@0: }; sl@0: sl@0: struct xtime sl@0: { sl@0: #if defined(BOOST_NO_INT64_T) sl@0: typedef int_fast32_t xtime_sec_t; //INT_FAST32_MIN <= sec <= INT_FAST32_MAX sl@0: #else sl@0: typedef int_fast64_t xtime_sec_t; //INT_FAST64_MIN <= sec <= INT_FAST64_MAX sl@0: #endif sl@0: sl@0: typedef int_fast32_t xtime_nsec_t; //0 <= xtime.nsec < NANOSECONDS_PER_SECOND sl@0: sl@0: xtime_sec_t sec; sl@0: xtime_nsec_t nsec; sl@0: }; sl@0: sl@0: int BOOST_THREAD_DECL xtime_get(struct xtime* xtp, int clock_type); sl@0: sl@0: inline int xtime_cmp(const xtime& xt1, const xtime& xt2) sl@0: { sl@0: if (xt1.sec == xt2.sec) sl@0: return (int)(xt1.nsec - xt2.nsec); sl@0: else sl@0: return (xt1.sec > xt2.sec) ? 1 : -1; sl@0: } sl@0: sl@0: } // namespace boost sl@0: sl@0: #endif //BOOST_XTIME_WEK070601_HPP