Skip to content
Snippets Groups Projects
Commit 5380e449 authored by Guy Zana's avatar Guy Zana
Browse files

bug fix in getmicrotime(), tvp->tv_usec wasn't set properly

parent 8c20af74
No related branches found
No related tags found
No related merge requests found
...@@ -13,11 +13,13 @@ int osv_curtid(void) ...@@ -13,11 +13,13 @@ int osv_curtid(void)
} }
#define NANOSEC (1000000000L) #define NANOSEC (1000000000L)
#define MICROSEC (1000000L)
void getmicrotime(struct timeval *tvp) void getmicrotime(struct timeval *tvp)
{ {
u64 ntm = clock::get()->time(); u64 ntm = clock::get()->time();
u64 utm = ntm / 1000L;
tvp->tv_sec = ntm/NANOSEC; tvp->tv_sec = ntm/NANOSEC;
tvp->tv_usec = (ntm - (tvp->tv_sec*NANOSEC))/1000; tvp->tv_usec = (utm - (tvp->tv_sec*MICROSEC));
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment