System.currentTimeMillis()是Java中时间性能的最佳衡量标准吗? [英] Is System.currentTimeMillis() the best measure of time performance in Java?

查看:164
本文介绍了System.currentTimeMillis()是Java中时间性能的最佳衡量标准吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.currentTimeMillis()是Java中时间性能的最佳衡量标准吗?使用它来比较采取行动之前的时间和采取行动之后的时间是否有任何问题?还有更好的选择吗?

Is System.currentTimeMillis() the best measure of time performance in Java? Are there any gotcha's when using this to compare the time before action is taken to the time after the action is taken? Is there a better alternative?

推荐答案

我希望不是 - 这是我在不使用 nanoTime()

I hope not - it's what I use when i don't use nanoTime().

这篇关于System.currentTimeMillis()是Java中时间性能的最佳衡量标准吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆