@@ -0,0 +1,2531 @@
+package com.lasarobotics.ftc.utils;%0A%0Aimport java.security.InvalidParameterException;%0Aimport java.util.HashMap;%0Aimport java.util.concurrent.TimeUnit;%0A%0A/**%0A * Created by Ehsan on 6/11/2015.%0A */%0Apublic class Timer %7B%0A    private HashMap%3CString,Long%3E store;%0A    private long precision;%0A    public Timer()%7B%0A        precision = 5L;%0A    %7D%0A    public Timer(long precision)%7B%0A        this.precision = precision;%0A    %7D%0A    public void startClock(String name)%7B%0A        store.put(name,System.nanoTime());%0A    %7D%0A    public void resetClock(String name)%7B%0A        if (store.containsKey(name))%7B%0A            store.put(name,System.nanoTime());%0A        %7D%0A        else%7B%0A            throw new IllegalArgumentException(%22Timer%22 + name + %22 does not exist.%22);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Get clock value. Defaults to millisecond precision.%0A     * @param name Name of the clock%0A     * @return Value of clock in milliseconds%0A     */%0A    public long getClockValue(String name)%7B%0A        if (store.containsKey(name))%7B%0A           Long start = store.get(name);%0A           return TimeUnit.MILLISECONDS.convert(Math.abs(System.nanoTime()-start),TimeUnit.NANOSECONDS);%0A        %7D%0A        else%7B%0A            throw new IllegalArgumentException(%22Timer%22 + name + %22 does not exist.%22);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Get clock value with precision in a given time unit%0A     * @param name Name of the clock%0A     * @param timeUnit TimeUnit the output should be in%0A     * @return The value of the clock converted to the time unit specified (may loose precision)%0A     */%0A    public long getClockValue(String name,TimeUnit timeUnit)%7B%0A        if (store.containsKey(name))%7B%0A            Long start = store.get(name);%0A            long nanoDiff = Math.abs(System.nanoTime() - start);%0A            return timeUnit.convert(nanoDiff,TimeUnit.NANOSECONDS);%0A        %7D%0A        else%7B%0A            throw new IllegalArgumentException(%22Timer%22 + name + %22 does not exist.%22);%0A        %7D%0A    %7D%0A%0A    public boolean isAtTargetMillis(String name, long target)%7B%0A        if (store.containsKey(name))%7B%0A            Long start = store.get(name);%0A            long milliDiff = TimeUnit.MILLISECONDS.convert(Math.abs(target - Math.abs(System.nanoTime()-start)),TimeUnit.NANOSECONDS);%0A            return milliDiff %3C precision;%0A        %7D%0A        else%7B%0A            throw new IllegalArgumentException(%22Timer%22 + name + %22 does not exist.%22);%0A        %7D%0A    %7D%0A%0A%0A    public long getPrecision() %7B%0A        return precision;%0A    %7D%0A%0A    public void setPrecision(long precision) %7B%0A        this.precision = precision;%0A    %7D%0A%7D%0A

Add Timer library