9 # define _QI_CLOCK_HPP_
13 # include <boost/chrono/chrono.hpp>
18 typedef boost::chrono::duration<int64_t, boost::nano>
Duration;
19 typedef boost::chrono::duration<int64_t, boost::nano>
NanoSeconds;
20 typedef boost::chrono::duration<int64_t, boost::micro>
MicroSeconds;
21 typedef boost::chrono::duration<int64_t, boost::milli>
MilliSeconds;
22 typedef boost::chrono::duration<int64_t>
Seconds;
23 typedef boost::chrono::duration<int64_t, boost::ratio<60> >
Minutes;
24 typedef boost::chrono::duration<int64_t, boost::ratio<3600> >
Hours;
39 typedef boost::chrono::duration<rep, period>
duration;
45 typedef boost::chrono::time_point<SteadyClock>
time_point;
51 BOOST_STATIC_CONSTEXPR
bool is_steady = boost::chrono::steady_clock::is_steady;
65 static time_point now();
81 typedef boost::chrono::duration<rep, period>
duration;
93 BOOST_STATIC_CONSTEXPR
bool is_steady = boost::chrono::steady_clock::is_steady;
104 static time_point now();
114 static uint32_t toUint32ms(
const time_point &t)
throw();
123 static int32_t toInt32ms(
const time_point &t)
throw();
144 static time_point fromUint32ms(
uint32_t t_ms, time_point guess,
145 Expect expect=Expect_SoonerOrLater) throw();
147 static time_point fromInt32ms(
int32_t t_ms, time_point guess,
148 Expect expect=Expect_SoonerOrLater) throw();
163 typedef boost::chrono::duration<rep, period>
duration;
173 BOOST_STATIC_CONSTEXPR
bool is_steady =
false;
181 static time_point now();
188 static std::time_t to_time_t(
const time_point& t)
throw();
196 static time_point from_time_t(
const std::time_t &t)
throw();
224 template <
class Rep,
class Period>
225 inline void sleepFor(
const boost::chrono::duration<Rep, Period>& d);
233 template <
class Duration>
234 inline void sleepUntil(
const boost::chrono::time_point<SteadyClock, Duration>& t);
240 template <
class Duration>
241 inline void sleepUntil(
const boost::chrono::time_point<Clock, Duration>& t);
251 template <
class Duration>
252 inline void sleepUntil(
const boost::chrono::time_point<SystemClock, Duration>& t);
268 template <
class DurationTo,
class TimePo
intFrom>
275 template class QI_API boost::chrono::duration<int64_t, boost::nano>;
276 template class QI_API boost::chrono::duration<int64_t, boost::micro>;
277 template class QI_API boost::chrono::duration<int64_t, boost::milli>;
278 template class QI_API boost::chrono::duration<int64_t>;
279 template class QI_API boost::chrono::duration<int64_t, boost::ratio<60> >;
280 template class QI_API boost::chrono::duration<int64_t, boost::ratio<3600> >;
281 template class QI_API boost::chrono::time_point<qi::SteadyClock>;
282 template class QI_API boost::chrono::time_point<qi::SystemClock>;
287 #endif // _QI_OS_HPP_
int64_t rep
The representation type of the duration and time_point.
SystemClock::time_point SystemClockTimePoint
System clock time point.
DurationTo durationSince(const TimePointFrom &t)
}@
boost::nano period
The tick period of the clock in nanoseconds.
boost::chrono::duration< rep, period > duration
The duration type of the clock.
int64_t rep
The representation type of the duration and time_point.
Result is expected to be later than user-provided reference.
boost::chrono::duration< int64_t, boost::nano > Duration
Convenience typedefs.
void sleepFor(const qi::Duration &d)
The SystemClock class represents the system-wide real time wall clock. It may not be monotonic: on mo...
boost::chrono::time_point< Clock > time_point
Expect
Enum expected argument.
dll import/export and compiler message
Result is expected to be later than user-provided reference.
std::string toISO8601String(const SystemClockTimePoint &t)
Return the date and time as a string in ISO 8601 format. The time is given up to millisecond precisio...
Clock::time_point ClockTimePoint
qi::Clock time point.
boost::nano period
The tick period of the clock in nanoseconds.
boost::chrono::duration< rep, period > duration
The duration type of the clock.
QI_API_DEPRECATED typedef SystemClock WallClock
The SteadyClock class represents a monotonic clock. <includename>qi/clock.hpp</includename> ...
QI_API_DEPRECATED SystemClockTimePoint wallClockNow()
Returns a time_point representing the current value of the clock.
QI_API_DEPRECATED SteadyClockTimePoint steadyClockNow()
Returns a time_point representing the current value of the clock.
boost::chrono::duration< int64_t, boost::ratio< 60 > > Minutes
Pick the nearest result to user-provided reference.
boost::nano period
The tick period of the clock in nanoseconds.
QI_API_DEPRECATED typedef time_point WallClockTimePoint
boost::chrono::duration< int64_t, boost::milli > MilliSeconds
int32_t int32_t
Cross-platform signed integer of length 32 bits (4 bytes).
boost::chrono::duration< int64_t, boost::nano > NanoSeconds
int64_t rep
The representation type of the duration and time_point.
QI_API_DEPRECATED typedef SystemClockTimePoint WallClockTimePoint
System clock time point.
Expect
Enum expected argument.
boost::chrono::duration< int64_t, boost::micro > MicroSeconds
static time_point now()
Returns a time_point representing the current value of the clock.
QI_API_DEPRECATED typedef time_point SteadyClockTimePoint
void sleepUntil(const SteadyClockTimePoint &t)
Blocks the execution of the current thread until t has been reached.
static time_point now()
Returns a time_point representing the current value of the clock.
#define QI_API_DEPRECATED
Compiler flags to mark a function as deprecated. It will generate a compiler warning.
boost::chrono::duration< int64_t > Seconds
boost::chrono::time_point< SystemClock > time_point
boost::chrono::time_point< SteadyClock > time_point
boost::chrono::duration< int64_t, boost::ratio< 3600 > > Hours
SteadyClock::time_point SteadyClockTimePoint
Steady clock time point.
The Clock class represents a system-wide clock, best suitable for timestamping events.
int64_t int64_t
Cross-platform signed integer of length 64 bits (8 bytes).
uint32_t uint32_t
Cross-platform unsigned integer of length 32 bits (4 bytes).
boost::chrono::duration< rep, period > duration
The duration type of the clock.
Pick the nearest result to user-provided reference.