Skip to content

Commit 2051b38

Browse files
Update libc-bottom-half/cloudlibc/src/common/time.h
Co-authored-by: Pat Hickey <[email protected]>
1 parent 60f063a commit 2051b38

File tree

1 file changed

+1
-1
lines changed
  • libc-bottom-half/cloudlibc/src/common

1 file changed

+1
-1
lines changed

libc-bottom-half/cloudlibc/src/common/time.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static inline struct timeval instant_to_timeval(
100100
monotonic_clock_instant_t ns) {
101101
// Decompose instant into seconds and microoseconds
102102
return (struct timeval){.tv_sec = ns / NSEC_PER_SEC,
103-
.tv_usec = ns % 1000};
103+
.tv_usec = (ns % NSEC_PER_SEC) / 1000};
104104
}
105105

106106
static inline struct timeval timestamp_to_timeval(

0 commit comments

Comments
 (0)