Commit bb9e6028 by Vicent Marti

Merge pull request #2507 from libgit2/rb/timer-typo

Typo in timer constants
parents 35f186b6 3822d2cc
...@@ -419,7 +419,7 @@ GIT_INLINE(double) git__timer(void) ...@@ -419,7 +419,7 @@ GIT_INLINE(double) git__timer(void)
scaling_factor = (double)info.numer / (double)info.denom; scaling_factor = (double)info.numer / (double)info.denom;
} }
return (double)time * scaling_factor / 1.0E-9; return (double)time * scaling_factor / 1.0E9;
} }
#else #else
...@@ -431,13 +431,13 @@ GIT_INLINE(double) git__timer(void) ...@@ -431,13 +431,13 @@ GIT_INLINE(double) git__timer(void)
struct timespec tp; struct timespec tp;
if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) { if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) {
return (double) tp.tv_sec + (double) tp.tv_nsec / 1E-9; return (double) tp.tv_sec + (double) tp.tv_nsec / 1.0E9;
} else { } else {
/* Fall back to using gettimeofday */ /* Fall back to using gettimeofday */
struct timeval tv; struct timeval tv;
struct timezone tz; struct timezone tz;
gettimeofday(&tv, &tz); gettimeofday(&tv, &tz);
return (double)tv.tv_sec + (double)tv.tv_usec / 1E-6; return (double)tv.tv_sec + (double)tv.tv_usec / 1.0E6;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment