package lc.mecha.util;

import java.time.Duration;
import java.time.Instant;

/**
 * A newer implementation of the StopWatch functionality using durations.
 *
 * @author Alex Leigh
 * @since mk12 mod10 (RETROGRADE)
 */
public class StopWatchV2 {
    private Instant start;
    private Instant stop;

    public StopWatchV2 start() {
        start = Instant.now();
        return this;
    }

    public Duration stop() {
        stop = Instant.now();
        return Duration.between(start, stop);
    }
}
