diff --git a/src/core/lib/support/time_posix.c b/src/core/lib/support/time_posix.c index cc0aa2b47638a25eb59a23a282ae14e3538d355b..11542072fe63d63a9405c6123cdb01cbfa13bef8 100644 --- a/src/core/lib/support/time_posix.c +++ b/src/core/lib/support/time_posix.c @@ -95,12 +95,6 @@ static gpr_timespec now_impl(gpr_clock_type clock_type) { return gpr_from_timespec(now, clock_type); } } - -gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type) = now_impl; - -gpr_timespec gpr_now(gpr_clock_type clock_type) { - return gpr_now_impl(clock_type); -} #else /* For some reason Apple's OSes haven't implemented clock_gettime. */ @@ -120,7 +114,7 @@ void gpr_time_init(void) { g_time_start = mach_absolute_time(); } -gpr_timespec gpr_now(gpr_clock_type clock) { +static gpr_timespec now_impl(gpr_clock_type clock) { gpr_timespec now; struct timeval now_tv; double now_dbl; @@ -148,6 +142,12 @@ gpr_timespec gpr_now(gpr_clock_type clock) { } #endif +gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type) = now_impl; + +gpr_timespec gpr_now(gpr_clock_type clock_type) { + return gpr_now_impl(clock_type); +} + void gpr_sleep_until(gpr_timespec until) { gpr_timespec now; gpr_timespec delta;