001package io.cui.tools.concurrent;
002
003import java.io.Serializable;
004
005/**
006 * A time source; returns a time value representing the number of nanoseconds elapsed since some
007 * fixed but arbitrary point in time. Note that most users should use {@link StopWatch} instead of
008 * interacting with this class directly.
009 *
010 * <p>
011 * <b>Warning:</b> this type can only be used to measure elapsed time, not wall time.
012 *
013 * @author com.google.common.base.Ticker
014 */
015public class Ticker implements Serializable {
016
017    private static final long serialVersionUID = -1361587646696392654L;
018
019    /** @return the number of nanoseconds elapsed since this ticker's fixed point of reference. */
020    public long read() {
021        return System.nanoTime();
022    }
023}