I have two methods that I wish to profile in netbeans
Here is there code
public static boolean compare1(int a,int b){
if((a-b)>10)
return true;
else
return false;
}
public static boolean compare2(int a,int b){
a = ((a&0xf00000)>>12)+((a&0xf000)>>8)+((a&0xf0)>>4);
b = ((b&0xf00000)>>12)+((b&0xf000)>>8)+((b&0xf0)>>4);
if(a==b)
return true;
else
return false;
}
How ever netbeans returns 0ms for both the methods !! I ran the netbeans profiler for the whole project and the snap shot says that the self time of each of these methods is 0ms.
I am calling these two methods from main using a loop 1000 times. If there execution time is so significantly less that they cannot be expressed in MS is there a way to express it in nano seconds ? I would be running these methods a million times per image frame which is 30 million times a second. I need to profile and choose the best method very badly.