java miliseconds find closest to current time
<p>I have following code </p>

<pre><code>for(int i=0; i&lt;a.length; i++){
    diff[i] = a.getTime() - b.getTime();
}

a.getTime() = time in array.
b.getTime() = current time on computer.
</code></pre>

<p>What would be the best way to find which one of a.getTime is nearest to current time?</p>

<p>Output diff:</p>

<pre><code>-143214521
32942394
-132931
-21340
</code></pre>

<p>Thank you!</p>
