Skip to content

Commit 281aa0f

Browse files
committed
Merge pull request #138 from kovpas/uuid_time_fix
Fix nanoseconds calculation in uuid.c
2 parents 9df8c0a + 7444e7e commit 281aa0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

uuid/uuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static inline void read_random(void *buffer, u_int numBytes) {
5757
static inline void nanotime(struct timespec *tv) {
5858
uint64_t now = mach_absolute_time();
5959
tv->tv_sec = now / 1000000000;
60-
tv->tv_nsec = (tv->tv_sec * 10000000000) - now;
60+
tv->tv_nsec = now - (tv->tv_sec * 1000000000);
6161
}
6262

6363
#elif TARGET_OS_LINUX

0 commit comments

Comments
 (0)