currenttimemillis

currenttimemilliscurrenttimemillis

currenttimemillis

1
But your benchmarking code must handle the possibility that it does no better than System. currentTimeMillis. 但是,它可能并不比System.currentTimeMillis好,基准测试代码必须处理这种可能性。
2
In contrast, System. currentTimeMillis merely involves reading a global variable, so it executes extremely quickly, in nanoseconds. 相反,System.currentTimeMillis只需要读取一个全局变量,所以执行得非常快,是纳秒级的。
3
A final issue with System. currentTimeMillis that affects even long-running tasks is that it is supposed to reflect "wall-clock" time. currentTimeMillis的最后一个问题是,假设它反映“墙上时钟”的时间,这个问题甚至会影响长时间运行的任务。
4
In reality, System. currentTimeMillis can have ~10-100 times worse resolution. Its Javadocs state 在真实环境中,System.currentTimeMillis的分辨率可能会糟糕~10-100倍。