History

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.

John Koleszar committed 16 years ago

Commit daab4bc1 parent d6ee72a1 file · +5 −5Browse files

Unified · Split

vpx_ports/vpx_timer.h+5−5
@@ -12,7 +12,7 @@ · 11 unmodified lines
12#ifndef VPX_TIMER_H12#ifndef VPX_TIMER_H
13#define VPX_TIMER_H13#define VPX_TIMER_H
14 14
15#if defined(_MSC_VER)15#if defined(_WIN32)
16/*16/*
17 * Win32 specific includes17 * Win32 specific includes
18 */18 */
@@ -43,7 +43,7 @@ · 24 unmodified lines
43 43
44struct vpx_usec_timer44struct vpx_usec_timer
45{45{
46#if defined(_MSC_VER)46#if defined(_WIN32)
47 LARGE_INTEGER begin, end;47 LARGE_INTEGER begin, end;
48#else48#else
49 struct timeval begin, end;49 struct timeval begin, end;
@@ -54,7 +54,7 @@ struct vpx_usec_timer · 4 unmodified lines
54static void54static void
55vpx_usec_timer_start(struct vpx_usec_timer *t)55vpx_usec_timer_start(struct vpx_usec_timer *t)
56{56{
57#if defined(_MSC_VER)57#if defined(_WIN32)
58 QueryPerformanceCounter(&t->begin);58 QueryPerformanceCounter(&t->begin);
59#else59#else
60 gettimeofday(&t->begin, NULL);60 gettimeofday(&t->begin, NULL);
@@ -65,7 +65,7 @@ vpx_usec_timer_start(struct vpx_usec_timer *t) · 4 unmodified lines
65static void65static void
66vpx_usec_timer_mark(struct vpx_usec_timer *t)66vpx_usec_timer_mark(struct vpx_usec_timer *t)
67{67{
68#if defined(_MSC_VER)68#if defined(_WIN32)
69 QueryPerformanceCounter(&t->end);69 QueryPerformanceCounter(&t->end);
70#else70#else
71 gettimeofday(&t->end, NULL);71 gettimeofday(&t->end, NULL);
@@ -76,7 +76,7 @@ vpx_usec_timer_mark(struct vpx_usec_timer *t) · 4 unmodified lines
76static long76static long
77vpx_usec_timer_elapsed(struct vpx_usec_timer *t)77vpx_usec_timer_elapsed(struct vpx_usec_timer *t)
78{78{
79#if defined(_MSC_VER)79#if defined(_WIN32)
80 LARGE_INTEGER freq, diff;80 LARGE_INTEGER freq, diff;
81 81
82 diff.QuadPart = t->end.QuadPart - t->begin.QuadPart;82 diff.QuadPart = t->end.QuadPart - t->begin.QuadPart;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t