$treeview $search $mathjax $extrastylesheet
artdaq_core
v3_06_01
$projectbrief
|
$projectbrief
|
$searchbox |
Namespace to hold useful time-converting functions. More...
Typedefs | |
typedef std::chrono::duration < double, std::ratio< 1 > > | seconds |
Functions | |
constexpr double | GetElapsedTime (std::chrono::steady_clock::time_point then, std::chrono::steady_clock::time_point now=std::chrono::steady_clock::now()) |
Get the number of seconds in the given interval. | |
constexpr size_t | GetElapsedTimeMicroseconds (std::chrono::steady_clock::time_point then, std::chrono::steady_clock::time_point now=std::chrono::steady_clock::now()) |
Gets the number of microseconds in the given time interval. | |
constexpr size_t | GetElapsedTimeMilliseconds (std::chrono::steady_clock::time_point then, std::chrono::steady_clock::time_point now=std::chrono::steady_clock::now()) |
Gets the number of milliseconds in the given time interval. | |
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). | |
struct timespec | get_realtime_clock () |
Get the current time of day as a pair of seconds and nanoseconds (from clock_gettime(CLOCK_REALTIME, ...) system call). | |
double | convertUnixTimeToSeconds (time_t inputUnixTime) |
Converts a Unix time to double. | |
double | convertUnixTimeToSeconds (struct timeval const &inputUnixTime) |
Converts a Unix time to double. | |
double | convertUnixTimeToSeconds (struct timespec const &inputUnixTime) |
Converts a Unix time to double. |
Namespace to hold useful time-converting functions.
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 22 of file TimeUtils.hh.
double artdaq::TimeUtils::convertUnixTimeToSeconds | ( | struct timespec const & | inputUnixTime | ) |
Converts a Unix time to double.
inputUnixTime | A struct timespec Unix time variable |
Definition at line 78 of file TimeUtils.cc.
double artdaq::TimeUtils::convertUnixTimeToSeconds | ( | struct timeval const & | inputUnixTime | ) |
Converts a Unix time to double.
inputUnixTime | A struct timeval Unix time variable |
Definition at line 72 of file TimeUtils.cc.
double artdaq::TimeUtils::convertUnixTimeToSeconds | ( | time_t | inputUnixTime | ) |
Converts a Unix time to double.
inputUnixTime | A time_t Unix time variable |
Definition at line 66 of file TimeUtils.cc.
std::string artdaq::TimeUtils::convertUnixTimeToString | ( | struct timespec const & | inputUnixTime | ) |
Converts a Unix time to its string representation, in UTC.
inputUnixTime | A struct timespec Unix time variable |
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.
inputUnixTime | A struct timeval Unix time variable |
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.
inputUnixTime | A time_t Unix time variable |
Definition at line 7 of file TimeUtils.cc.
struct timespec artdaq::TimeUtils::get_realtime_clock | ( | ) | [read] |
Get the current time of day as a pair of seconds and nanoseconds (from clock_gettime(CLOCK_REALTIME, ...) system call).
Definition at line 58 of file TimeUtils.cc.
constexpr double artdaq::TimeUtils::GetElapsedTime | ( | std::chrono::steady_clock::time_point | then, | |
std::chrono::steady_clock::time_point | now = std::chrono::steady_clock::now() | |||
) | [inline] |
Get the number of seconds in the given interval.
then | std::chrono::steady_clock::time_point representing start of interval | |
now | std::chrono::steady_clock::time_point representing end of interval. Defaults to std::chrono::steady_clock::now() |
Definition at line 30 of file TimeUtils.hh.
constexpr size_t artdaq::TimeUtils::GetElapsedTimeMicroseconds | ( | std::chrono::steady_clock::time_point | then, | |
std::chrono::steady_clock::time_point | now = std::chrono::steady_clock::now() | |||
) | [inline] |
Gets the number of microseconds in the given time interval.
then | std::chrono::steady_clock::time_point representing start of interval | |
now | std::chrono::steady_clock::time_point representing end of interval. Defaults to std::chrono::steady_clock::now() |
Definition at line 41 of file TimeUtils.hh.
constexpr size_t artdaq::TimeUtils::GetElapsedTimeMilliseconds | ( | std::chrono::steady_clock::time_point | then, | |
std::chrono::steady_clock::time_point | now = std::chrono::steady_clock::now() | |||
) | [inline] |
Gets the number of milliseconds in the given time interval.
then | std::chrono::steady_clock::time_point representing start of interval | |
now | std::chrono::steady_clock::time_point representing end of interval. Defaults to std::chrono::steady_clock::now() |
Definition at line 52 of file TimeUtils.hh.
uint64_t artdaq::TimeUtils::gettimeofday_us | ( | ) |
Get the current time of day in microseconds (from gettimeofday system call).
Definition at line 51 of file TimeUtils.cc.