home *** CD-ROM | disk | FTP | other *** search
Java Source | 2004-01-31 | 558 b | 20 lines |
- class JITSpeedTest {
- public static int jitFunc() {
- int retVal = 0;
- for(int i=0; i<1000; i++) {
- for(int j=0; j<1000; j++) {
- retVal += i+j;
- }
- }
- return retVal;
- }
-
- public static void main(String[] args) throws Exception {
- // JITTest myJT = new JITTest();
- System.out.println("Now starting timing");
- long start = System.currentTimeMillis();
- System.out.println("Call to JIT Function returned: " + jitFunc());
- long end = System.currentTimeMillis();
- System.out.println("Took " + (end-start) + " milliseconds");
- }
- }