What i do:
1.I called a c++ method from java by generating wrapper using the swig intermediate file.
2.I used clock() time inside c++ code, to calculate the total time taken in the method writtern in c++(Differnce from start to end) .
clock_t start=clock();
clock_t end=clock();
double elapsed_secs = double(end - start) / (CLOCKS_PER_SEC)*1000;
3.In the java, i used System.CurrentTimeMillis() to calculate the time taken to call the method.
What i have to know:
When calculating the both difference in milliseconds,it was found that the time difference taken inside the c++ is more than the time difference while calling the method in java.
1.How the time taken while calling the method from java is less than the toatal time taken inside the method?
2.Is there any difference between the clock() time and the System.CurrentTimeMillis()?