< prev index next >

src/hotspot/share/runtime/timer.cpp

Print this page
rev 47415 : Add Thread Local handshakes and thread local polling

*** 1,7 **** /* ! * Copyright (c) 1997, 2016, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 35,44 **** --- 35,49 ---- double TimeHelper::counter_to_millis(jlong counter) { 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(); assert(osTimeUnitsPerSecond % 1000 == 0, "must be"); assert(timeUnitsPerSecond % 1000 == 0, "must be");
< prev index next >