1#ifndef __JEEP__JTIMEKEEPER__
2#define __JEEP__JTIMEKEEPER__
20namespace JPP {
using namespace JEEP; }
113 reset(getLocalTime());
147 static const useconds_t MAXIMAL_SLEEP_TIME_US = std::numeric_limits<useconds_t>::max();
151 while (delay > MAXIMAL_SLEEP_TIME_US && usleep(MAXIMAL_SLEEP_TIME_US) == 0) {
154 delay -= MAXIMAL_SLEEP_TIME_US;
157 if (delay > 0 && usleep((useconds_t) delay) == 0) {
178 long long int t1 = getLocalTime();
187 JTimeval timeout((
int) (delay/1000000), (
int) (delay%1000000));
210 mutable long long int t0;
long long int total_delay
total delay time [us]
long long int getDelay() const
Get total delay time.
bool wait(JFileDescriptorMask &mask) const
Wait until the number of time intervals has elapsed since the last call to the reset method or input ...
void setInterval(const long long int interval_us)
Set interval time.
long long int t0
t0 of elapsed time [us]
JTimekeeper()
Default constructor.
void wait() const
Wait until the number of time intervals has elapsed since the last call to the reset method.
JTimekeeper(const long long int interval_us)
Constructor.
long long int interval
interval time [us]
void reset(const long long int t0)
Reset time.
bool operator()() const
Check whether the number of time intervals has elapsed since the last call to the reset method.
long long int counter
interval counter
long long int getInterval() const
Get interval time.
Auxiliary class for method select.
bool in_avail(JTimeval timeout=JTimeval::min())
Check availability of input.
Auxiliary class for time values.
General puprpose classes and methods.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const JLocalTime getLocalTime
Function object to get local time in micro seconds.