13 #if defined(ECL_IS_POSIX)
22 #include <ecl/config/ecl.hpp>
24 #include "../../include/ecl/time/timestamp_pos.hpp"
37 TimeStamp::TimeStamp() {
41 TimeStamp::TimeStamp (
const double& decimal_time_value) :
42 TimeStampBase(decimal_time_value)
45 TimeStamp::TimeStamp (
const time_t& seconds,
const long& nanoseconds) :
46 TimeStampBase(seconds, nanoseconds)
49 TimeStamp::TimeStamp(
const TimeStampBase& base) : TimeStampBase(base) {}
55 const TimeStamp& TimeStamp::stamp() {
56 if ( epoch_time(time).flag() != NoError ) {
62 #if defined(ECL_HAS_RT_TIMERS)
63 TimeStamp TimeStamp::realtime_now() {
65 if ( realtime_epoch_time(time).flag() != NoError ) {
68 return TimeStamp(time.tv_sec, time.tv_nsec);
77 #ifdef ECL_HAS_EXCEPTIONS
81 StandardException throwTimeStampException(
const char* loc) {
82 int error_result = errno;
83 switch (error_result) {
88 std::ostringstream ostream;
89 ostream <<
"Unknown posix error " << error_result <<
": " << strerror(error_result) <<
".";