Skip to content

Commit e6f2812

Browse files
committed
Enhance documentation for ITicker interface with detailed description of high resolution time source and utility methods
1 parent c7e60bb commit e6f2812

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

affinity/src/main/java/net/openhft/ticker/ITicker.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,23 @@
1717

1818
package net.openhft.ticker;
1919

20-
/*
21-
* Created by Peter Lawrey on 13/07/15.
20+
/**
21+
* Abstraction of a high resolution time source used throughout the library.
22+
* <p>
23+
* Implementations may be based on {@link System#nanoTime()} or platform
24+
* specific timers such as the processor's time stamp counter accessed via
25+
* JNI. The {@linkplain #ticks() tick values} returned are therefore
26+
* implementation dependent. They always increase monotonically but the unit
27+
* they represent can vary from nanoseconds to CPU cycles.
28+
* <p>
29+
* Utility methods are provided to convert these raw ticks into conventional
30+
* time units. For example {@link #toNanos(long)} converts the supplied number
31+
* of ticks to nanoseconds and {@link #toMicros(double)} converts them to
32+
* microseconds.
33+
* <p>
34+
* This interface is typically accessed via the {@link net.openhft.ticker.Ticker}
35+
* helper class which selects the best available implementation for the
36+
* running platform.
2237
*/
2338
public interface ITicker {
2439
long nanoTime();

0 commit comments

Comments
 (0)