During bug fixing in very old project I\'ve faced with strange method, it looks like this:
void waiter() { for (int i = 0; i < 20000; i++) ;
It will be optimized after few runs by JIT. The JVM , at the first run, needs to check if the value if i that is being incremented is not being used anywhere.
i
Check this article as well :
Java: how much time does an empty loop use?