package com.hithomelabs.princeton1.module5;

public class SortingMetaData {

    private double tick;
    private double tok;
    private int exchanges;
    private int compares;

    public double timeElapsed(){
        return tok - tick;
    }

    public void startTime(){
        tick = System.nanoTime();
    }

    public void endTime(){
        tok = System.nanoTime();
    }

    public void incrementCompares(){
        ++compares;
    }

    public void incrementExchanges(){
        ++exchanges;
    }

    @Override
    public String toString() {
        return "Time elapsed: " + this.timeElapsed() + " nano-seconds \nCompares: "+this.compares+ "\nSwaps: "+this.exchanges;
    }
}
