class Timer {

    public DiscreteInterval getTimeRemaining() {
        if (!wasSet) throw new IllegalStateException("cannot compute time remaining without having duration set");
        if (startTime == null) return targetElapsedTime;
        DiscreteInterval diff = targetEndTime.minus(clock.getNanoTime());
        return (diff.getMin() <= 0L) ? new DiscreteInterval(0L,0L) : diff;
    }

    public  Timer();
    public  Timer(HardwareClock clock);

}