Package com.ocient.util

# Class SimpleMillisCounter

java.lang.Object
com.ocient.util.SimpleMillisCounter

All Implemented Interfaces:
  `DurationCounter`

public class SimpleMillisCounter extends Object implements DurationCounter

## Constructor Summary

Constructors
Constructor
Description
`SimpleMillisCounter()`

## Method Summary

Modifier and Type
Method
Description
`long`
`getAndReset()`
Retrieves the elapsed time duration between the "start" and "end" points, and then resets the internal state of the counter for subsequent measurements.
`void`
`start()`
Starts the time measurement.
`void`
`stop()`
Ends the time measurement.

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

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

## Constructor Details

### SimpleMillisCounter

public SimpleMillisCounter()

## Method Details

### start

public void start()
Description copied from interface: `DurationCounter`
Starts the time measurement. This method should be called when you want to begin measuring the duration.

Specified by:
  `start` in interface `DurationCounter`

### stop

public void stop()
Description copied from interface: `DurationCounter`
Ends the time measurement. This method should be called when you want to stop measuring the duration.

Specified by:
  `stop` in interface `DurationCounter`

### getAndReset

public long getAndReset()
Description copied from interface: `DurationCounter`
Retrieves the elapsed time duration between the "start" and "end" points, and then resets the internal state of the counter for subsequent measurements.

Specified by:
  `getAndReset` in interface `DurationCounter`
Returns:
  The elapsed time duration in millis (possibly 0). -1 if called when counter has started but not stopped.