There's no useful reason to limit this timer to 1 second.
Change-Id: Idd1960268624e8bdfe958d99833ae6482fdb423e
#ifndef VPX_TIMER_H
#define VPX_TIMER_H
+#include "vpx/vpx_integer.h"
#if CONFIG_OS_SUPPORT
}
-static long
+static int64_t
vpx_usec_timer_elapsed(struct vpx_usec_timer *t)
{
#if defined(_WIN32)
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
}