src/hotspot/share/runtime/timer.cpp
changeset 47881 0ce0ac68ace7
parent 47216 71c04702a3d5
child 53520 5178e4b58b17
--- a/src/hotspot/share/runtime/timer.cpp	Sat Nov 11 01:21:09 2017 +0100
+++ b/src/hotspot/share/runtime/timer.cpp	Thu Aug 31 10:00:28 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,11 @@
   return counter_to_seconds(counter) * 1000.0;
 }
 
+jlong TimeHelper::millis_to_counter(jlong millis) {
+  jlong freq = os::elapsed_frequency() / MILLIUNITS;
+  return millis * freq;
+}
+
 elapsedTimer::elapsedTimer(jlong time, jlong timeUnitsPerSecond) {
   _active = false;
   jlong osTimeUnitsPerSecond = os::elapsed_frequency();