numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_collect::logging::time_stamp Class Reference

Class of time stamps. More...

#include <num_collect/logging/time_stamp.h>

+ Collaboration diagram for num_collect::logging::time_stamp:

Public Member Functions

 time_stamp (std::time_t seconds, std::uint32_t nanoseconds) noexcept
 Constructor.
 
auto nanoseconds () const noexcept -> std::uint32_t
 Get the number of nanoseconds from the time specified by seconds.
 
auto seconds () const noexcept -> std::time_t
 Get the number of seconds from the epoch.
 

Static Public Member Functions

static auto now () noexcept -> time_stamp
 Get the current time stamp.
 

Private Attributes

std::uint32_t nanoseconds_
 Number of nanoseconds from the time specified by seconds_ (from 0 to 999999999).
 
std::time_t seconds_
 Number of seconds from the epoch.
 

Detailed Description

Class of time stamps.

Note
This class uses UTC time.

Definition at line 38 of file time_stamp.h.

Constructor & Destructor Documentation

◆ time_stamp()

num_collect::logging::time_stamp::time_stamp ( std::time_t seconds,
std::uint32_t nanoseconds )
noexcept

Constructor.

Parameters
[in]secondsNumber of seconds from the epoch.
[in]nanosecondsNumber of nanoseconds from the time specified by seconds (from 0 to 999999999).

Member Function Documentation

◆ nanoseconds()

auto num_collect::logging::time_stamp::nanoseconds ( ) const -> std::uint32_t
nodiscardnoexcept

Get the number of nanoseconds from the time specified by seconds.

Returns
Number of nanoseconds from the time specified by seconds.

◆ now()

static auto num_collect::logging::time_stamp::now ( ) -> time_stamp
staticnodiscardnoexcept

Get the current time stamp.

Returns
Time stamp.

◆ seconds()

auto num_collect::logging::time_stamp::seconds ( ) const -> std::time_t
nodiscardnoexcept

Get the number of seconds from the epoch.

Returns
Number of seconds from the epoch.

Member Data Documentation

◆ nanoseconds_

std::uint32_t num_collect::logging::time_stamp::nanoseconds_
private

Number of nanoseconds from the time specified by seconds_ (from 0 to 999999999).

Definition at line 75 of file time_stamp.h.

◆ seconds_

std::time_t num_collect::logging::time_stamp::seconds_
private

Number of seconds from the epoch.

Definition at line 72 of file time_stamp.h.


The documentation for this class was generated from the following file: