com.thinkaurelius.titan.diskstorage.util.time

## Class Timer

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.util.time.Timer

-     public class Timer
      extends Object

  A utility to measure time durations. Differs from Guava Stopwatch in the following ways:
  - encapsulates longs behind Instant/Duration
  - replacing the underlying Ticker with a TimestampProvider
  - can only be started and stopped once

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Timer(TimestampProvider times)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Duration` | `elapsed()`
    `Timepoint` | `getStartTime()`
    `long` | `getStartTime(TimeUnit u)`
    `Timer` | `start()`
    `Timer` | `stop()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Timer

          public Timer(TimestampProvider times)

  - ### Method Detail

    - #### start

          public Timer start()

    - #### getStartTime

          public long getStartTime(TimeUnit u)

    - #### getStartTime

          public Timepoint getStartTime()

    - #### stop

          public Timer stop()

    - #### elapsed

          public Duration elapsed()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2012–2014. All rights reserved.