How to disable compiler and JVM optimizations?

前端 未结 4 543
小鲜肉
小鲜肉 2020-12-01 18:35

I have this code that is testing Calendar.getInstance().getTimeInMillis() vs System.currentTimeMilli() :

long before = getTimeInMil         


        
4条回答
  •  旧巷少年郎
    2020-12-01 18:54

    I think you need to disable JIT. Add to your run command next option:

    -Djava.compiler=NONE
    

提交回复
热议问题