timer.MicroTimer.cc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proactive-programming Show documentation
Show all versions of proactive-programming Show documentation
ProActive Programming is a Java API that provides a powerful framework to easily develop parallel and distributed applications
The newest version!
#include "jni.h"
#include "MicroTimer.h"
#include
#include
JNIEXPORT jlongArray JNICALL Java_org_objectweb_proactive_core_util_timer_MicroTimer_currentTime (JNIEnv* env, jobject obj)
{
struct timeval current;
struct timezone currentTZ;
jsize size=2;
jlongArray tablo = env->NewLongArray(size);
jlong* localArray = env->GetLongArrayElements(tablo, NULL);
gettimeofday(¤t, ¤tTZ);
localArray[0]=current.tv_sec;
localArray[1]=current.tv_usec;
// printf("Puting \n");
env->ReleaseLongArrayElements(tablo, localArray, 0);
return tablo;
}