src/hotspot/share/runtime/timer.cpp
changeset 47881 0ce0ac68ace7
parent 47216 71c04702a3d5
child 53520 5178e4b58b17
equal deleted inserted replaced
47824:cf127be65014 47881:0ce0ac68ace7
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    33   return counter / freq;
    33   return counter / freq;
    34 }
    34 }
    35 
    35 
    36 double TimeHelper::counter_to_millis(jlong counter) {
    36 double TimeHelper::counter_to_millis(jlong counter) {
    37   return counter_to_seconds(counter) * 1000.0;
    37   return counter_to_seconds(counter) * 1000.0;
       
    38 }
       
    39 
       
    40 jlong TimeHelper::millis_to_counter(jlong millis) {
       
    41   jlong freq = os::elapsed_frequency() / MILLIUNITS;
       
    42   return millis * freq;
    38 }
    43 }
    39 
    44 
    40 elapsedTimer::elapsedTimer(jlong time, jlong timeUnitsPerSecond) {
    45 elapsedTimer::elapsedTimer(jlong time, jlong timeUnitsPerSecond) {
    41   _active = false;
    46   _active = false;
    42   jlong osTimeUnitsPerSecond = os::elapsed_frequency();
    47   jlong osTimeUnitsPerSecond = os::elapsed_frequency();