aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/native/NativewindowCommon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nativewindow/native/NativewindowCommon.c')
-rw-r--r--src/nativewindow/native/NativewindowCommon.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nativewindow/native/NativewindowCommon.c b/src/nativewindow/native/NativewindowCommon.c
index e909c0494..212bdf82f 100644
--- a/src/nativewindow/native/NativewindowCommon.c
+++ b/src/nativewindow/native/NativewindowCommon.c
@@ -1,6 +1,7 @@
#include "NativewindowCommon.h"
#include <string.h>
+#include <sys/time.h>
static const char * const ClazzNameRuntimeException = "java/lang/RuntimeException";
static jclass runtimeExceptionClz=NULL;
@@ -106,3 +107,9 @@ JNIEnv* NativewindowCommon_GetJNIEnv (JavaVM * jvmHandle, int jvmVersion, int as
return curEnv;
}
+int64_t NativewindowCommon_CurrentTimeMillis() {
+ struct timeval tv;
+ gettimeofday(&tv,NULL);
+ return (int64_t)tv.tv_sec * 1000 + tv.tv_usec / 1000;
+}
+