Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calculating MIPS

843829May 10 2007
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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2007
Added on May 10 2007
0 comments
506 views