forked from Ocean/datum_gateway
utils: Correct comments in current_time_{micros,nanos}
This commit is contained in:
parent
bcc70fbfc6
commit
7a7587ad8c
@ -128,15 +128,15 @@ uint64_t current_time_millis(void) {
|
|||||||
uint64_t current_time_micros(void) {
|
uint64_t current_time_micros(void) {
|
||||||
struct timeval te;
|
struct timeval te;
|
||||||
gettimeofday(&te, NULL); // get current time
|
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;
|
return microseconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t current_time_nanos(void) {
|
uint64_t current_time_nanos(void) {
|
||||||
struct timespec te;
|
struct timespec te;
|
||||||
clock_gettime(CLOCK_REALTIME, &te);
|
clock_gettime(CLOCK_REALTIME, &te);
|
||||||
uint64_t microseconds = te.tv_sec * 1000000000LL + te.tv_nsec; // calculate nanoseconds
|
uint64_t nanoseconds = te.tv_sec * 1000000000LL + te.tv_nsec; // calculate nanoseconds
|
||||||
return microseconds;
|
return nanoseconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char hex_lookup[65536];
|
unsigned char hex_lookup[65536];
|
||||||
|
Loading…
Reference in New Issue
Block a user