Commit daab4bcb authored by John Koleszar's avatar John Koleszar

Use native win32 timers on mingw

Changed to use QueryPerformanceCounter on Windows rather than only
when building with MSVC, so that MSVC can link libs built with
MinGW.

Fixes issue #149.

Change-Id: Ie2dc7edc8f4d096cf95ec5ffb1ab00f2d67b3e7d
parent d6ee72a7
......@@ -12,7 +12,7 @@
#ifndef VPX_TIMER_H
#define VPX_TIMER_H
#if defined(_MSC_VER)
#if defined(_WIN32)
/*
* Win32 specific includes
*/
......@@ -43,7 +43,7 @@
struct vpx_usec_timer
{
#if defined(_MSC_VER)
#if defined(_WIN32)
LARGE_INTEGER begin, end;
#else
struct timeval begin, end;
......@@ -54,7 +54,7 @@ struct vpx_usec_timer
static void
vpx_usec_timer_start(struct vpx_usec_timer *t)
{
#if defined(_MSC_VER)
#if defined(_WIN32)
QueryPerformanceCounter(&t->begin);
#else
gettimeofday(&t->begin, NULL);
......@@ -65,7 +65,7 @@ vpx_usec_timer_start(struct vpx_usec_timer *t)
static void
vpx_usec_timer_mark(struct vpx_usec_timer *t)
{
#if defined(_MSC_VER)
#if defined(_WIN32)
QueryPerformanceCounter(&t->end);
#else
gettimeofday(&t->end, NULL);
......@@ -76,7 +76,7 @@ vpx_usec_timer_mark(struct vpx_usec_timer *t)
static long
vpx_usec_timer_elapsed(struct vpx_usec_timer *t)
{
#if defined(_MSC_VER)
#if defined(_WIN32)
LARGE_INTEGER freq, diff;
diff.QuadPart = t->end.QuadPart - t->begin.QuadPart;
......
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