template<class T>
Magnum::Math::Seconds class new in Git master

Seconds.

Represents a floating-point second value. Compared to Nanoseconds, the Magnum::Seconds typedef uses a 32-bit float which offers a microsecond-level precision and a reasonable range for scenarios where storing a full 64-bit nanosecond value isn't needed. See Nanoseconds for more information and usage examples.

Base classes

template<template<class> class Derived, class T>
class Unit<Seconds, T>
Base class for units.

Constructors, destructors, conversion operators

Seconds() constexpr noexcept
Default constructor.
Seconds(ZeroInitT) explicit constexpr noexcept
Construct a zero time.
Seconds(Magnum::NoInitT) explicit noexcept
Construct without initializing the contents.
Seconds(T value) explicit constexpr noexcept
Explicit constructor from a unitless type.
Seconds(Unit<Math::Seconds, T> other) constexpr noexcept
Copy constructor.
template<class U>
Seconds(Unit<Nanoseconds, U> value) constexpr noexcept
Construct seconds from nanoseconds.
template<class U, class V = decltype(Implementation::SecondsConverter<T, U>::from(std::declval<U>()))>
Seconds(const U& other) explicit constexpr noexcept
Construct seconds from external representation.
template<class U, class V = decltype(Implementation::SecondsConverter<T, U>::to(std::declval<Seconds<T>>()))>
operator U() const explicit constexpr
Convert seconds to external representation.

Function documentation

template<class T>
Magnum::Math::Seconds<T>::Seconds() constexpr noexcept

Default constructor.

Equivalent to Seconds(ZeroInitT).

template<class T> template<class U>
Magnum::Math::Seconds<T>::Seconds(Unit<Nanoseconds, U> value) constexpr noexcept

Construct seconds from nanoseconds.

A floating-point value can accurately only represent microseconds and only in a limited range, so the conversion may result in some precision loss.

template<class T>
Utility::Debug& operator<<(Utility::Debug& debug, const Unit<Seconds, Float>& value) new in Git master

Debug output operator.