Skip to content
Snippets Groups Projects
Commit bdffdc04 authored by Craig Tiller's avatar Craig Tiller
Browse files

Merge pull request #4031 from jtattermusch/win_precise_clock

Use QueryPerformanceCounter as precise clock for windows
parents faa29182 04f40545
Branches
Tags
No related merge requests found
......@@ -66,14 +66,12 @@ gpr_timespec gpr_now(gpr_clock_type clock) {
now_tv.tv_nsec = now_tb.millitm * 1000000;
break;
case GPR_CLOCK_MONOTONIC:
case GPR_CLOCK_PRECISE:
QueryPerformanceCounter(&timestamp);
now_dbl = (timestamp.QuadPart - g_start_time.QuadPart) * g_time_scale;
now_tv.tv_sec = (time_t)now_dbl;
now_tv.tv_nsec = (int)((now_dbl - (double)now_tv.tv_sec) * 1e9);
break;
case GPR_CLOCK_PRECISE:
gpr_precise_clock_now(&now_tv);
break;
}
return now_tv;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment