utils: Correct comments in current_time_{micros,nanos}

This commit is contained in:
Luke Dashjr 2024-10-19 17:45:09 +00:00
parent bcc70fbfc6
commit 7a7587ad8c
No known key found for this signature in database
GPG Key ID: A291A2C45D0C504A

View File

@ -128,15 +128,15 @@ uint64_t current_time_millis(void) {
uint64_t current_time_micros(void) {
struct timeval te;
gettimeofday(&te, NULL); // get current time
uint64_t microseconds = te.tv_sec * 1000000LL + te.tv_usec; // calculate nanoseconds
uint64_t microseconds = te.tv_sec * 1000000LL + te.tv_usec; // calculate microseconds
return microseconds;
}
uint64_t current_time_nanos(void) {
struct timespec te;
clock_gettime(CLOCK_REALTIME, &te);
uint64_t microseconds = te.tv_sec * 1000000000LL + te.tv_nsec; // calculate nanoseconds
return microseconds;
uint64_t nanoseconds = te.tv_sec * 1000000000LL + te.tv_nsec; // calculate nanoseconds
return nanoseconds;
}
unsigned char hex_lookup[65536];