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
1212 #ifndef VPX_TIMER_H
1313 #define VPX_TIMER_H
1414
15−#if defined(_MSC_VER)
15+#if defined(_WIN32)
1616 /*
1717 * Win32 specific includes
1818 */
@@ -43,7 +43,7 @@ · 24 unmodified lines
4343
4444 struct vpx_usec_timer
4545 {
46−#if defined(_MSC_VER)
46+#if defined(_WIN32)
4747 LARGE_INTEGER begin, end;
4848 #else
4949 struct timeval begin, end;
@@ -54,7 +54,7 @@ struct vpx_usec_timer · 4 unmodified lines
5454 static void
5555 vpx_usec_timer_start(struct vpx_usec_timer *t)
5656 {
57−#if defined(_MSC_VER)
57+#if defined(_WIN32)
5858 QueryPerformanceCounter(&t->begin);
5959 #else
6060 gettimeofday(&t->begin, NULL);
@@ -65,7 +65,7 @@ vpx_usec_timer_start(struct vpx_usec_timer *t) · 4 unmodified lines
6565 static void
6666 vpx_usec_timer_mark(struct vpx_usec_timer *t)
6767 {
68−#if defined(_MSC_VER)
68+#if defined(_WIN32)
6969 QueryPerformanceCounter(&t->end);
7070 #else
7171 gettimeofday(&t->end, NULL);
@@ -76,7 +76,7 @@ vpx_usec_timer_mark(struct vpx_usec_timer *t) · 4 unmodified lines
7676 static long
7777 vpx_usec_timer_elapsed(struct vpx_usec_timer *t)
7878 {
79−#if defined(_MSC_VER)
79+#if defined(_WIN32)
8080 LARGE_INTEGER freq, diff;
8181
8282 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