Calculating MIPS
Hi everyone,
I am trying to measure computer performance by calculating MIPS. The mathematics formula is:
MIPS = Instructions count/(Execution time * 10^6)
My algorithm would likely be,
startTime = new Date().getTime();
for(int i = 0; i < nIterations; i++) {
for(int j = 0, k = nElements - 1; j < nElements; j++, k--) {
iOut[j] = iIn[j] + iIn[k];
}
}
endTime = new Date().getTime();
I should be able calculate execution time by doing (endTime - startTime).
Is there a way to calculate the # of machine instructions between the loops using Java?
Any help will be valuable. Thank you!