Fixposition SDK 0.0.0-heads/main-0-g4d935a0
Collection of c++ libraries and apps for use with Fixposition products on Linux
Loading...
Searching...
No Matches
fpsdk::common::time Namespace Reference

Time utilities. More...

Classes

class  TicToc
 Helper to measure wallclock time. More...
struct  RosTime
 Minimal ros::Time() / rplcpp::Time implementation (that doesn't throw). More...
class  Duration
 Time duration. More...
struct  WnoTow
 GNSS atomic time representation: week number (wno) and time of week (tow) used by GPS, Galileo and BeiDou. More...
struct  GloTime
 GLONASS time. More...
struct  UtcTime
 UTC time representation. More...
class  Time
 Time. More...

Functions

uint64_t GetMillis ()
 Get milliseconds [ms].
double GetSecs ()
 Get seconds [s].
static constexpr int SEC_IN_MIN_I = 60
 Constants.
static constexpr int SEC_IN_HOUR_I = 60 * SEC_IN_MIN_I
 Number of seconds in an hour (integer) = 3600.
static constexpr int SEC_IN_DAY_I = 24 * SEC_IN_HOUR_I
 Number of seconds in a day (integer) = 86400.
static constexpr int SEC_IN_WEEK_I = 7 * SEC_IN_DAY_I
 Number of seconds in a week (integer) = 604800.
static constexpr double SEC_IN_MIN_D = static_cast<double>(SEC_IN_MIN_I)
 Number of seconds in a minute (double) = 60.0.
static constexpr double SEC_IN_HOUR_D = static_cast<double>(SEC_IN_HOUR_I)
 Number of seconds in an hour (double) = 3600.0.
static constexpr double SEC_IN_DAY_D = static_cast<double>(SEC_IN_DAY_I)
 Number of seconds in a day (double) = 86400.0.
static constexpr double SEC_IN_WEEK_D = static_cast<double>(SEC_IN_WEEK_I)
 Number of seconds in a week (double) = 604800.0.
static constexpr double NsecToSec (const uint64_t ns)
 Convert seconds to nanoseconds.
static constexpr uint64_t SecToNsec (const double sec)
 Convert nanoseconds to seconds.

Detailed Description

Time utilities.

Function Documentation

◆ NsecToSec()

constexpr double fpsdk::common::time::NsecToSec ( const uint64_t ns)
staticconstexpr

Convert seconds to nanoseconds.

Note
Depending on the ns value this can be lossy.
Parameters
[in]nsNanoseconds alue
Returns
the seconds value

Definition at line 67 of file time.hpp.

◆ SecToNsec()

constexpr uint64_t fpsdk::common::time::SecToNsec ( const double sec)
staticconstexpr

Convert nanoseconds to seconds.

Parameters
[in]secSeconds value
Returns
the nanoseconds value

Definition at line 79 of file time.hpp.

◆ GetMillis()

uint64_t fpsdk::common::time::GetMillis ( )

Get milliseconds [ms].

Time is monotonic time since first call to GetMillis() or GetSecs().

Returns
the number of milliseconds (> 0)

◆ GetSecs()

double fpsdk::common::time::GetSecs ( )

Get seconds [s].

Time is monotonic time since first call to GetMillis() or GetSecs().

Returns
the number of seconds

Variable Documentation

◆ SEC_IN_MIN_I

int fpsdk::common::time::SEC_IN_MIN_I = 60
staticconstexpr

Constants.

Number of seconds in a minute (integer) = 60

Definition at line 48 of file time.hpp.

◆ SEC_IN_HOUR_I

int fpsdk::common::time::SEC_IN_HOUR_I = 60 * SEC_IN_MIN_I
staticconstexpr

Number of seconds in an hour (integer) = 3600.

Definition at line 49 of file time.hpp.

◆ SEC_IN_DAY_I

int fpsdk::common::time::SEC_IN_DAY_I = 24 * SEC_IN_HOUR_I
staticconstexpr

Number of seconds in a day (integer) = 86400.

Definition at line 50 of file time.hpp.

◆ SEC_IN_WEEK_I

int fpsdk::common::time::SEC_IN_WEEK_I = 7 * SEC_IN_DAY_I
staticconstexpr

Number of seconds in a week (integer) = 604800.

Definition at line 51 of file time.hpp.

◆ SEC_IN_MIN_D

double fpsdk::common::time::SEC_IN_MIN_D = static_cast<double>(SEC_IN_MIN_I)
staticconstexpr

Number of seconds in a minute (double) = 60.0.

Definition at line 52 of file time.hpp.

◆ SEC_IN_HOUR_D

double fpsdk::common::time::SEC_IN_HOUR_D = static_cast<double>(SEC_IN_HOUR_I)
staticconstexpr

Number of seconds in an hour (double) = 3600.0.

Definition at line 53 of file time.hpp.

◆ SEC_IN_DAY_D

double fpsdk::common::time::SEC_IN_DAY_D = static_cast<double>(SEC_IN_DAY_I)
staticconstexpr

Number of seconds in a day (double) = 86400.0.

Definition at line 54 of file time.hpp.

◆ SEC_IN_WEEK_D

double fpsdk::common::time::SEC_IN_WEEK_D = static_cast<double>(SEC_IN_WEEK_I)
staticconstexpr

Number of seconds in a week (double) = 604800.0.

Definition at line 55 of file time.hpp.