artdaq::TimeUtils Namespace Reference

Namespace to hold useful time-converting functions. More...

Typedefs

typedef std::chrono::duration
< double, std::ratio< 1 > > 
seconds

Functions

std::string convertUnixTimeToString (time_t inputUnixTime)
 Converts a Unix time to its string representation, in UTC.
std::string convertUnixTimeToString (struct timeval const &inputUnixTime)
 Converts a Unix time to its string representation, in UTC.
std::string convertUnixTimeToString (struct timespec const &inputUnixTime)
 Converts a Unix time to its string representation, in UTC.
uint64_t gettimeofday_us ()
 Get the current time of day in microseconds (from gettimeofday system call).

Detailed Description

Namespace to hold useful time-converting functions.


Typedef Documentation

typedef std::chrono::duration<double, std::ratio<1> > artdaq::TimeUtils::seconds

We shall use artdaq::detail::seconds as our "standard" duration type. Note that this differs from std::chrono::seconds, which has a representation in some integer type of at least 35 bits.

daqrate::duration dur(1.0) represents a duration of 1 second. daqrate::duration dur2(0.001) represents a duration of 1 millisecond.

Definition at line 24 of file TimeUtils.hh.


Function Documentation

std::string artdaq::TimeUtils::convertUnixTimeToString ( struct timespec const &  inputUnixTime  ) 

Converts a Unix time to its string representation, in UTC.

Parameters:
inputUnixTime A struct timespec Unix time variable
Returns:
std::string representation of Unix time, in UTC

Definition at line 35 of file TimeUtils.cc.

std::string artdaq::TimeUtils::convertUnixTimeToString ( struct timeval const &  inputUnixTime  ) 

Converts a Unix time to its string representation, in UTC.

Parameters:
inputUnixTime A struct timeval Unix time variable
Returns:
std::string representation of Unix time, in UTC

Definition at line 18 of file TimeUtils.cc.

std::string artdaq::TimeUtils::convertUnixTimeToString ( time_t  inputUnixTime  ) 

Converts a Unix time to its string representation, in UTC.

Parameters:
inputUnixTime A time_t Unix time variable
Returns:
std::string representation of Unix time, in UTC

Definition at line 7 of file TimeUtils.cc.

uint64_t artdaq::TimeUtils::gettimeofday_us (  ) 

Get the current time of day in microseconds (from gettimeofday system call).

Returns:
The current time of day in microseconds

Definition at line 51 of file TimeUtils.cc.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on 21 Nov 2017 for artdaq_core by  doxygen 1.6.1