Constructors

Synopses

Declared in <bsls_timeinterval.h>

Create a time interval having the value of 0 seconds and 0 nanoseconds.

constexpr
TimeInterval();

Create a time interval from a real number of seconds.

explicit
TimeInterval(double seconds);

Create a time interval from an implicitly convertible duration.

template<
    class REP_TYPE,
    class PERIOD_TYPE>
constexpr
TimeInterval(std::chrono::duration<REP_TYPE, PERIOD_TYPE> const& duration)
requires TimeInterval_DurationTraits<
                                   REP_TYPE,
                                   PERIOD_TYPE>::k_IMPLICIT_CONVERSION_ENABLED;

Create a time interval from an explicitly convertible duration.

template<
    class REP_TYPE,
    class PERIOD_TYPE>
constexpr
explicit
TimeInterval(std::chrono::duration<REP_TYPE, PERIOD_TYPE> const& duration)
requires TimeInterval_DurationTraits<
                                   REP_TYPE,
                                   PERIOD_TYPE>::k_EXPLICIT_CONVERSION_ENABLED;

Create a time interval from seconds and nanoseconds.

constexpr
TimeInterval(
    bsls::Types::Int64 seconds,
    int nanoseconds);

Parameters

Name

Description

seconds

interval length in seconds

duration

chrono duration to convert

nanoseconds

nanoseconds component

Created with MrDocs