I want to know how many instructions my java code consumes to execute. I am looking for an api which starts the instruction count and the final total number of instructions should be returned at the end
For example:
public static void main()
{
int a=0;
int b=0;
int c=0;
startCountinst();
if(a==b)
{
c++;
}
int n = stopCountinst();
}
At the end, n should represent the total number of instructions executed after calling startCountinst()
. Is it possible in java to count the instructions?