diff src/share/vm/runtime/timer.cpp @ 13103:c0b0974dd509

moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
author Doug Simon <doug.simon@oracle.com>
date Thu, 21 Nov 2013 22:08:04 +0100
parents f2110083203d
children d8041d695d19
line wrap: on
line diff
--- a/src/share/vm/runtime/timer.cpp	Thu Nov 21 15:04:54 2013 +0100
+++ b/src/share/vm/runtime/timer.cpp	Thu Nov 21 22:08:04 2013 +0100
@@ -45,6 +45,22 @@
   return counter/freq;
 }
 
+elapsedTimer::elapsedTimer(jlong time, jlong timeUnitsPerSecond) {
+  _active = false;
+  jlong osTimeUnitsPerSecond = os::elapsed_frequency();
+  assert(osTimeUnitsPerSecond % 1000 == 0, "must be");
+  assert(timeUnitsPerSecond % 1000 == 0, "must be");
+  while (osTimeUnitsPerSecond < timeUnitsPerSecond) {
+    timeUnitsPerSecond /= 1000;
+    time *= 1000;
+  }
+  while (osTimeUnitsPerSecond > timeUnitsPerSecond) {
+    timeUnitsPerSecond *= 1000;
+    time /= 1000;
+  }
+  _counter = time;
+}
+
 void elapsedTimer::add(elapsedTimer t) {
   _counter += t._counter;
 }