首页 > 编程语言 > 详细

java时间差

时间:2019-09-07 14:32:30      阅读:65      评论:0      收藏:0      [点我收藏+]

以下代码没什么意义,只是记录

long mstart = System.nanoTime();

int mIndex = 0 ;

for (int i = 0; i < 100000000; i++) {
mIndex = i ;
if ( mIndex >= 0 ){
}
}

long mend = System.nanoTime();

for (int i = 0; i < 100000000; i++) {
mIndex = i ;
if ( mIndex > -1 ){
}
}

long mend_o = System.nanoTime();


BigDecimal diff = BigDecimal.valueOf(mend-mstart,5);
BigDecimal diff_o = BigDecimal.valueOf(mend_o-mend,5);

java时间差

原文:https://www.cnblogs.com/Wicher-lsl/p/11480486.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!