38#ifndef BLOCXX_TIMEOUT_TIMER_HPP_INCLUDE_GUARD_
39#define BLOCXX_TIMEOUT_TIMER_HPP_INCLUDE_GUARD_
41#include "blocxx/BLOCXX_config.h"
46#ifdef BLOCXX_HAVE_SYS_TIME_H
114#ifdef BLOCXX_HAVE_STRUCT_TIMEVAL
116 ::timeval* asTimeval(::timeval& tv,
double maxSeconds)
const;
118 ::timeval* asTimeval(::timeval& tv)
const;
121#ifdef BLOCXX_HAVE_STRUCT_TIMESPEC
123 ::timespec* asTimespec(::timespec& ts)
const;
137 ::DWORD asDWORDMs()
const;
142 int asIntMs(
double maxSeconds)
const;
The DateTime class is an abstraction for date time data.
A timeout can be absolute, which means that it will happen at the specified DateTime.
TimeoutTimer(const Timeout &x)
bool expired() const
Indicates whether the last loop time has exceeded the timeout.
void start()
Meant to be called by timeout functions which loop.
void loop()
Meant to be called by timeout functions which loop, but don't want to reset the interval.
double calcSeconds() const
Timeout asRelativeTimeout() const
Timeout asTimeout() const
Timeout asAbsoluteTimeout() const
Converts the timer to an absolute timeout.
virtual DateTime getCurrentTime() const
void resetOnLoop()
Meant to be called by timeout functions which loop, and that want to reset the interval.
bool infinite() const
Indicates whether the timeout will never expire.