I want to profile my class, it is something like a buffer where I save my user's data and get it after. I've created main method and run the test method in endless cycle there.
public void test(){
buffer.add(n1);
Message message = buffer.remove();
msgSeqNum = message.getMsgSeqNum();
}
msgSeqNum is global variable, I've made it in order to JVM not to remove my call(I think it can help me).
I was profiling it for 30 seconds, but as I can see my code was run about 40 times(I expected a few thousands). I also see the spaces in JMC(see screenshot) which show me that my JVM did nothing. There were not GC, Exceptions, looks, waiting time and my code works very fast.
I tried to run it several time but I was getting the same result. Why does it happen?
OS - windows