misc. bugfixes and tweaks

This commit is contained in:
Joel Dice
2007-07-28 10:10:13 -06:00
parent 363801af1c
commit 41bee5829e
12 changed files with 228 additions and 141 deletions

View File

@ -1,3 +1,6 @@
#include "sys/time.h"
#include "time.h"
#include "time.h"
#include "string.h"
#include "jni.h"
@ -19,3 +22,12 @@ Java_java_lang_System_getProperty(JNIEnv* e, jclass, jstring key)
return value;
}
extern "C" JNIEXPORT jlong JNICALL
Java_java_lang_System_currentTimeMillis(JNIEnv*, jclass)
{
timeval tv = { 0, 0 };
gettimeofday(&tv, 0);
return (static_cast<jlong>(tv.tv_sec) * 1000) +
(static_cast<jlong>(tv.tv_usec) / 1000);
}