guarantees that the expression
cannot be compiled into a constant or be dead-code
eliminated.
//Fredrik
2009/10/1 Fredrik Ohrstrom :
> You are trusting nanoTime to actually return values that are useful!
> They might be completely useless for your timing purposes. :-)
> It all depends on the har
You are trusting nanoTime to actually return values that are useful!
They might be completely useless for your timing purposes. :-)
It all depends on the hardware you are running.
Read the spec:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#nanoTime()
The reason for this is that
As Rich says, a cache would probably destroy the performance.
The current prerequisite to optimizing away boxed parameters, is that the
JVM can inline the function call and the JVM usually inlines a lot!
It can even inline code that C++ cannot, i.e. code that is virtual.
It avoids code bloat by on