Skip to content

Commit

Permalink
time: Retain usecs from in new value
Browse files Browse the repository at this point in the history
Issue: 6584

Retain the useconds portion of the timestamp when creating
the new structure
  • Loading branch information
jlucovsky committed Dec 2, 2023
1 parent 9c3ab36 commit 25e6eee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util-time.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ typedef struct {
#define SCTIME_USECS(t) ((uint64_t)(t).usecs)
#define SCTIME_SECS(t) ((uint64_t)(t).secs)
#define SCTIME_MSECS(t) (SCTIME_SECS(t) * 1000 + SCTIME_USECS(t) / 1000)
#define SCTIME_ADD_SECS(ts, s) SCTIME_FROM_SECS((ts).secs + (s))
#define SCTIME_ADD_SECS(ts, s) \
(SCTime_t) \
{ \
.secs = (ts).secs + (s), .usecs = (ts).usecs \
}
#define SCTIME_ADD_USECS(ts, us) SCTIME_FROM_USECS((ts).usecs + (us))
#define SCTIME_FROM_SECS(s) \
(SCTime_t) \
Expand Down

0 comments on commit 25e6eee

Please sign in to comment.