本文整理汇总了Java中com.sun.squawk.VM.getTimeMicros方法的典型用法代码示例。如果您正苦于以下问题:Java VM.getTimeMicros方法的具体用法?Java VM.getTimeMicros怎么用?Java VM.getTimeMicros使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.squawk.VM
的用法示例。
在下文中一共展示了VM.getTimeMicros方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: nativeUsleep
import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
* Sleep usec microseconds using native code
* @param usec
*/
void nativeUsleep(int usec) {
long time = VM.getTimeMicros();
usleepPtr.call1(usec);
time = VM.getTimeMicros() - time;
if (time - usec != 0) {
System.out.println("nativeUsleep missed deadline of " + usec + " usec by " + (time - usec));
} else {
System.out.println("nativeUsleep of " + usec + " ok");
}
}
示例2: systemSleep
import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
* Sleep ms milliseconds using native code
* @param ms
*/
void systemSleep(int ms) {
long time = VM.getTimeMicros();
sleep(ms);
time = VM.getTimeMicros() - time;
if (time - (ms * 1000) != 0) {
System.out.println("sleep missed deadline of " + ms + " ms by " + (time - (ms * 1000)) + " usec");
} else {
System.out.println("sleep of " + ms + " ok");
}
}
示例3: timeDummyFunc
import com.sun.squawk.VM; //导入方法依赖的package包/类
long timeDummyFunc() {
long time = VM.getTimeMicros();
dummyFuncPtr.call0();
return VM.getTimeMicros() - time;
}
示例4: timeDummyFuncNB
import com.sun.squawk.VM; //导入方法依赖的package包/类
long timeDummyFuncNB() {
long time = VM.getTimeMicros();
dummyFuncNBPtr.call0();
return VM.getTimeMicros() - time;
}