vpx_timer: increase resolution
There's no useful reason to limit this timer to 1 second. Change-Id: Idd1960268624e8bdfe958d99833ae6482fdb423e
This commit is contained in:
parent
9e50ed7f27
commit
a6f538cefa
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user