15 #include "../../include/ecl/time/timestamp_base.hpp"
29 time.tv_sec =
static_cast<long>(decimal_time_value);
30 time.tv_nsec = (decimal_time_value -
static_cast<long>(decimal_time_value))*1000000000L;
35 ( (seconds < 0) && (nanoseconds <= 0) ) ||
38 time.tv_sec = seconds;
39 time.tv_nsec = nanoseconds;
47 time.tv_sec =
static_cast<time_t
>(decimal_time_value);
48 time.tv_nsec = (decimal_time_value -
static_cast<long>(decimal_time_value))*1000000000L;
54 ( (seconds < 0) && (nanoseconds <= 0) ) ||
57 time.tv_sec = seconds;
58 time.tv_nsec = nanoseconds;
67 if( ( time_stamp.
time.tv_sec ==
time.tv_sec ) && ( time_stamp.
time.tv_nsec ==
time.tv_nsec ) ) {
75 if( ( time_stamp.time.tv_sec ==
time.tv_sec ) && ( time_stamp.time.tv_nsec ==
time.tv_nsec ) ) {
83 if(
time.tv_sec > time_stamp.time.tv_sec ) {
85 }
else if (
time.tv_sec == time_stamp.time.tv_sec ) {
86 if (
time.tv_nsec > time_stamp.time.tv_nsec ) {
94 if(
time.tv_sec < time_stamp.time.tv_sec ) {
96 }
else if (
time.tv_sec == time_stamp.time.tv_sec ) {
97 if (
time.tv_nsec < time_stamp.time.tv_nsec ) {
105 if(
time.tv_sec > time_stamp.time.tv_sec ) {
107 }
else if (
time.tv_sec == time_stamp.time.tv_sec ) {
108 if (
time.tv_nsec >= time_stamp.time.tv_nsec ) {
116 if(
time.tv_sec < time_stamp.time.tv_sec ) {
118 }
else if (
time.tv_sec == time_stamp.time.tv_sec ) {
119 if (
time.tv_nsec <= time_stamp.time.tv_nsec ) {
130 time.tv_sec += time_stamp.time.tv_sec;
131 int64
nsec =
time.tv_nsec + time_stamp.time.tv_nsec;
132 if (
nsec >= 1000000000L ) {
135 }
else if (
nsec <= -1000000000L ) {
139 if ( (
time.tv_sec > 0 ) && (
nsec < 0 ) ) {
143 if ( (
time.tv_sec < 0 ) && (
nsec > 0 ) ) {
151 long sec =
time.tv_sec + time_stamp.time.tv_sec;
152 int64
nsec =
time.tv_nsec + time_stamp.time.tv_nsec;
153 if (
nsec >= 1000000000L ) {
156 }
else if (
nsec <= -1000000000L ) {
160 if ( (
sec > 0 ) && (
nsec < 0 ) ) {
164 if ( (
sec < 0 ) && (
nsec > 0 ) ) {
172 time_t
sec =
time.tv_sec - time_stamp.time.tv_sec;
173 long nsec =
time.tv_nsec - time_stamp.time.tv_nsec;
178 }
else if ( (
sec < 0) && (
nsec > 0 )) {
187 time_t
sec =
time.tv_sec - time_stamp.time.tv_sec;
188 long nsec =
time.tv_nsec - time_stamp.time.tv_nsec;
193 }
else if ( (
sec < 0) && (
nsec > 0 )) {