Redian新闻
>
Re: JAVA中测时间的方法?
avatar
Re: JAVA中测时间的方法?# Java - 爪哇娇娃
y*h
1

For reference only,
copied from Java Developer Connection Forum, written by
knoxos:
avatar
d*x
2
The best I could do was using JNI to invoke the Solaris high resolution
timer. That gave me a resolution of around 30us(the cost mostly being
the JNI overhead and Solaris System call overhead).
On i386 platforms, you can directly get hardware clock from a register.
This register exists on Pentium+ machines, it records every tick of the
CPU. So for a 1GHz box, that is a nanosec resolution timer(well, not
exactly, there will be some overhead in reading the register). This wouldn't
help in Java tho
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。