Skip to content

Commit

Permalink
HSEARCH-4069 Add method nanoTime to TimingSource
Browse files Browse the repository at this point in the history
  • Loading branch information
fax4ever authored and yrodiere committed Nov 5, 2020
1 parent 095b4df commit 33201bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Expand Up @@ -62,6 +62,11 @@ public void ensureInitialized() {
}
}

@Override
public long nanoTime() {
return System.nanoTime();
}

@Override
public synchronized void stop() {
if ( future != null ) {
Expand Down
Expand Up @@ -33,4 +33,12 @@ public interface TimingSource {
*/
void ensureInitialized();

/**
* Returns current system time in nanoseconds.
* Accuracy is preferred over performance by the implementation.
*
* @return high precision current time in nanoseconds.
*/
long nanoTime();

}

0 comments on commit 33201bd

Please sign in to comment.