public long timeLeft(TimeUnit timeUnit) {
        long remaining = timeUnit.convert(timeLeft().toMillis(), TimeUnit.MILLISECONDS);

        if (remaining > 0)
            return remaining;
        else
            throw new TimeoutException("Timed out");
    }
Handles timeout of a task.
@author Tony Vaagenes
fileacquirer/src/main/java/com/yahoo/filedistribution/fileacquirer/Timer.java