File tree Expand file tree Collapse file tree 3 files changed +6
-11
lines changed
software/chronicle/enterprise/internals/impl Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1616
1717package net .openhft .ticker .impl ;
1818
19-
2019import net .openhft .ticker .ITicker ;
2120import software .chronicle .enterprise .internals .impl .NativeAffinity ;
2221
3231public enum JNIClock implements ITicker {
3332 INSTANCE ;
3433
35- private static final Logger LOGGER = Logger .getLogger (JNIClock .class .getName ());
3634 public static final boolean LOADED ;
35+ private static final Logger LOGGER = Logger .getLogger (JNIClock .class .getName ());
3736 private static final int FACTOR_BITS = 17 ;
37+ private static final long START ;
3838 private static long RDTSC_FACTOR = 1 << FACTOR_BITS ;
3939 private static double RDTSC_MICRO_FACTOR = 1e-3 ;
4040 private static long CPU_FREQUENCY = 1000 ;
41- private static final long START ;
4241
4342 static {
4443 boolean loaded ;
@@ -61,11 +60,6 @@ public enum JNIClock implements ITicker {
6160 START = start ;
6261 }
6362
64-
65- public long nanoTime () {
66- return tscToNano (rdtsc0 () - START );
67- }
68-
6963 static long tscToNano (final long tsc ) {
7064 return (tsc * RDTSC_FACTOR ) >> FACTOR_BITS ;
7165 }
@@ -90,6 +84,10 @@ private static void estimateFrequency(int factor) {
9084
9185 native static long rdtsc0 ();
9286
87+ public long nanoTime () {
88+ return tscToNano (rdtsc0 () - START );
89+ }
90+
9391 @ Override
9492 public long ticks () {
9593 return rdtsc0 ();
Original file line number Diff line number Diff line change 2727public enum SystemClock implements ITicker {
2828 INSTANCE ;
2929
30-
3130 @ Override
3231 public long nanoTime () {
3332 return System .nanoTime ();
@@ -48,5 +47,4 @@ public double toMicros(double ticks) {
4847 return ticks / 1e3 ;
4948 }
5049
51-
5250}
Original file line number Diff line number Diff line change 11package software .chronicle .enterprise .internals .impl ;
22
3-
43import net .openhft .affinity .IAffinity ;
54
65import java .util .BitSet ;
You can’t perform that action at this time.
0 commit comments