Commit c21f53a5 authored by John Koleszar's avatar John Koleszar Committed by Gerrit Code Review
Browse files

Merge "vpx_timer: increase resolution"

parents 7a159071 a6f538ce
......@@ -11,6 +11,7 @@
#ifndef VPX_TIMER_H
#define VPX_TIMER_H
#include "vpx/vpx_integer.h"
#if CONFIG_OS_SUPPORT
......@@ -75,7 +76,7 @@ vpx_usec_timer_mark(struct vpx_usec_timer *t)
}
static long
static int64_t
vpx_usec_timer_elapsed(struct vpx_usec_timer *t)
{
#if defined(_WIN32)
......@@ -83,15 +84,13 @@ vpx_usec_timer_elapsed(struct vpx_usec_timer *t)
diff.QuadPart = t->end.QuadPart - t->begin.QuadPart;
if (QueryPerformanceFrequency(&freq) && diff.QuadPart < freq.QuadPart)
return (long)(diff.QuadPart * 1000000 / freq.QuadPart);
return 1000000;
QueryPerformanceFrequency(&freq);
return diff.QuadPart * 1000000 / freq.QuadPart;
#else
struct timeval diff;
timersub(&t->end, &t->begin, &diff);
return diff.tv_sec ? 1000000 : diff.tv_usec;
return diff.tv_sec * 1000000 + diff.tv_usec;
#endif
}
......
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