about summary refs log tree commit diff
path: root/src/engine/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/system.c')
-rw-r--r--src/engine/system.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/engine/system.c b/src/engine/system.c
index f5696b91..6226d4d2 100644
--- a/src/engine/system.c
+++ b/src/engine/system.c
@@ -258,8 +258,12 @@ int64 time_get()
 	gettimeofday(&val, NULL);
 	return (int64)val.tv_sec*(int64)1000000+(int64)val.tv_usec;
 #elif defined(CONF_FAMILY_WINDOWS)
+	static int64 last = 0;
 	int64 t;
 	QueryPerformanceCounter((PLARGE_INTEGER)&t);
+	if(t<last) /* for some reason, QPC can return values in the past */
+		return last;
+	last = t;
 	return t;
 #else
 	#error not implemented