Created
May 10, 2016 19:34
-
-
Save jentfoo/fac286698ad8954948232e8c32051e93 to your computer and use it in GitHub Desktop.
Threadly guava ticker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.threadly.util.Clock; | |
import com.google.common.base.Ticker; | |
/** | |
* Adapter between guava's {@link Ticker} and threadly's {@link Clock}. | |
*/ | |
public class ThreadlyTicker extends Ticker { | |
public static final ThreadlyTicker INSTANCE = new ThreadlyTicker(); | |
@Override | |
public long read() { | |
return Clock.lastKnownTimeNanos(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment