comparison src/hotspot/share/runtime/timer.cpp @ 52291:35a6956f4243

8209976: Improve iteration over non-JavaThreads Summary: Add NonJavaThread and move NamedThread iteration to new class. Reviewed-by: eosterlund, coleenp, rkennke
author kbarrett
date Tue, 28 Aug 2018 16:04:54 -0400
parents 71c04702a3d5
children 5178e4b58b17
comparison
equal deleted inserted replaced
0:a651c7148ddd 1:55d156723b4a
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();