I am supposed to measure the running time of certain tree operations. for some reason when printing x or y i get the whole number but when trying to print (y-x) i get an unusually small number! i get 2000 instead of 200,000.
long y=0;
long x=0;
for(int j=0 ; j < 1000 ; j++)
{
if(j%100==0) System.out.println(y-x);
x = System.nanoTime();
myTree.put(n, 0);
y = System.nanoTime();
}