1 package ch.ethz.prose.jikesrvm; 2 3 import ch.ethz.inf.util.junit.PerformanceTest; 4 5 import com.ibm.JikesRVM.VM_Time; 6 7 12 public class JikesRVMPerformanceTest extends PerformanceTest { 13 14 public static final double MILLIS_TO_NANOS = 1000000.0; 15 16 protected static long startCycle; 17 18 protected static long endCycle; 19 20 public JikesRVMPerformanceTest(String name) { 21 super(name); 22 } 23 24 public static void startChronometer() { 25 startCycle = VM_Time.cycles(); 26 } 27 28 public static void stopChronometer() { 29 endCycle = VM_Time.cycles(); 30 } 31 32 35 public long readChronometer() { 36 return (long) (VM_Time.cyclesToMillis(endCycle - startCycle) * MILLIS_TO_NANOS); 37 } 38 39 } 40 | Popular Tags |