75 TimeVal(
unsigned long seconds,
unsigned long microSeconds,
76 unsigned long nanoSeconds);
81 TimeVal(
unsigned long seconds,
unsigned long nanoSeconds);
86 TimeVal(
const struct timeval& tVal);
127 void setMjd(
unsigned long days,
unsigned long seconds,
128 unsigned long nanoSeconds);
133 void setMjd(
unsigned long days,
unsigned long milliSeconds);
144 void setTime(
unsigned long seconds,
unsigned long microSeconds,
145 unsigned long nanoSeconds);
150 void setTime(
unsigned long seconds,
unsigned long nanoSeconds);
155 void setTime(
const struct timespec& timeSpec);
160 void setTime(
const struct timeval& tVal);
289 unsigned int getMjdId(
unsigned nanoSecondInterval);
320 std::string getUtcString();
322 std::string dateString();
336 struct timeval timeVal_;
340 struct timespec timeSpec_;
344 unsigned long seconds_;
345 unsigned long nanoSeconds_;
350 unsigned long mjdDays_;
351 unsigned long mjdSeconds_;
352 unsigned long mjdNanoSeconds_;
382 void setNanoSeconds(
unsigned long nanoSeconds);
388 #endif // End #ifndef
void setToCurrentTime(clockid_t clock=CLOCK_REALTIME)
Fill this structure with the current time from the specified clock.
double getFractionalMjdDay()
Return the feactional part only of the mjd day as a double.
double getTimeInSeconds()
Return the time in our timeval struct as fractional seconds.
A class for managing timeval/timespec structs.
const TimeVal operator-(const TimeVal &tVal)
Subtract two TimeVal objects.
unsigned long getMjdDays()
Return the mjd day number corresponding to this time.
void reset()
Reset our internal timeval struct to stored values.
friend std::ostream & operator<<(std::ostream &os, TimeVal &tVal)
Allows cout << timeVal.
unsigned long getSeconds()
Return just the integer seconds.
unsigned long getMjdMilliSeconds()
Return the mjd milliseconds corresponding to this time.
double getTimeInMicroSeconds()
Return the total time in microseconds.
unsigned int getMjdId(unsigned nanoSecondInterval)
Get a unique identifier based on the MJD.
unsigned long getMjdSeconds()
Return the mjd seconds corresponding to this time.
struct timeval * timeVal()
Return a pointer to our internal timeval struct.
double getFractionalTimeInSeconds()
Return just the fractional seconds, as a double.
double getElapsedTimeInMicroSeconds()
Return the time in our timeVal struct as integer microseconds.
void setMicroSeconds(unsigned long microSeconds)
Set the microseconds in this struct.
unsigned long getMicroSeconds()
Return just the integer micro seconds.
void setTime(unsigned long seconds, unsigned long microSeconds, unsigned long nanoSeconds)
Set the time.
void incrementNanoSeconds(unsigned nanoSeconds)
Increment the time by nanoseconds.
const TimeVal operator+(const TimeVal &tVal)
Add two TimeVal objects.
unsigned long getTimeInNanoSeconds()
Return the total time as integer nanoseconds.
struct timespec * timeSpec()
Return a pointer to our internal timespec struct.
void incrementSeconds(double seconds)
Increment the time by fractional seconds.
double getElapsedTimeInSeconds()
Return the time elapsed as fractional seconds.
TimeVal()
Constructors with no initialization.
double getTimeInMilliSeconds()
Return the total time in milliseconds.
unsigned long getElapsedTimeInNanoSeconds()
Return the time in our timeVal struct as integer nanoseconds.
double getMjd()
Return the complete mjd day as a double.
void setMjd(unsigned long days, unsigned long seconds, unsigned long nanoSeconds)
Set the time, as an MJD.
unsigned long getMjdNanoSeconds()
Return the mjd nanoseconds corresponding to this time.
double getTimeInMjdDays()
Return the total time in MJD days.
void setSeconds(unsigned long seconds)
Set the seconds in this object.
unsigned long getNanoSeconds()
Return just the integer nano seconds.