Some sun.misc internal APIs are deprectaed in JDK 9 and will be encapsulated or removed in a future release.
case 'D': { long initValue = (value != null)? ((Number)value).longValue() : 0L; ByteBuffer b = perf.createLong(name, V_Variable, V_None, initValue); b.order(ByteOrder.nativeOrder()); counters.put(name, b); buf[0] = '\0'; ByteBuffer b = perf.createByteArray(name, V_Variable, V_String, buf, buf.length); counters.put(name, b);
@Override public long current () { return _timer.highResCounter(); }
public PerfTimer () { _timer = Perf.getPerf(); init(_timer.highResFrequency() / 1000, _timer.highResFrequency() / 1000000); }
public SunHighResTimer() { ticksPerSecond = perf.highResFrequency(); }
public sun.misc.Perf run() { return sun.misc.Perf.getPerf(); } });
@Override public long current () { return _timer.highResCounter(); }
public PerfTimer () { _timer = Perf.getPerf(); init(_timer.highResFrequency() / 1000, _timer.highResFrequency() / 1000000); }
public SunHighResTimer() { ticksPerSecond = perf.highResFrequency(); }
/** * Returns the current value of the most precise available system timer, in milliseconds. This * method is used to measure elapsed time and is not related to any other notion of system or * wall-clock time. * * @return The current value of the system timer, in milliseconds. */ public long timeMillis() { return ((_perf.highResCounter() * TO_MILLISECONDS) / TICKS_PER_SECOND); }
SunPerfProvider() { perf = (sun.misc.Perf) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return sun.misc.Perf.getPerf(); } }); // trying to avoid BOTH overflow and rounding errors long numerator = 1000000000; long denominator = perf.highResFrequency(); long gcd = gcd(numerator, denominator); this.multiplier = numerator / gcd; this.divisor = denominator / gcd; } public long nanoTime() {
case 'D': { long initValue = (value != null) ? ((Number) value).longValue() : 0L; ByteBuffer b = perf.createLong(name, V_Variable, V_None, initValue); b.order(ByteOrder.nativeOrder()); counters.put(name, b); buf[0] = '\0'; ByteBuffer b = perf.createByteArray(name, V_Variable, V_String, buf, buf.length); counters.put(name, b);
public long getCurrentTime() { return perf.highResCounter(); }
SunPerfProvider() { perf = (sun.misc.Perf) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return sun.misc.Perf.getPerf(); } }); // trying to avoid BOTH overflow and rounding errors long numerator = 1000000000; long denominator = perf.highResFrequency(); long gcd = gcd(numerator, denominator); this.multiplier = numerator / gcd; this.divisor = denominator / gcd; } public long nanoTime() {
private static PerfInstrumentation attach(int pid) throws IllegalArgumentException, IOException { try { ByteBuffer bb = sun.misc.Perf.getPerf().attach(pid, "r"); PerfInstrumentation instr = new PerfInstrumentation(bb); return instr; } catch(NoClassDefFoundError e) { // try JDK 9 package ByteBuffer bb = jdk.internal.perf.Perf.getPerf().attach(pid, "r"); PerfInstrumentation instr = new PerfInstrumentation(bb); return instr; } }
case 'D': { long initValue = (value != null) ? ((Number) value).longValue() : 0L; ByteBuffer b = perf.createLong(name, V_Variable, V_None, initValue); b.order(ByteOrder.nativeOrder()); counters.put(name, b); buf[0] = '\0'; ByteBuffer b = perf.createByteArray(name, V_Variable, V_String, buf, buf.length); counters.put(name, b);
public long getCurrentTime() { return perf.highResCounter(); }
SunPerfProvider() { perf = (sun.misc.Perf) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return sun.misc.Perf.getPerf(); } }); // trying to avoid BOTH overflow and rounding errors long numerator = 1000000000; long denominator = perf.highResFrequency(); long gcd = gcd(numerator, denominator); this.multiplier = numerator / gcd; this.divisor = denominator / gcd; } public long nanoTime() {
public long nanoTime() { long ctr = perf.highResCounter();