Clarify use of System.nanoTime for measuring eviction times

This commit is contained in:
Jason Tedor 2015-10-07 11:03:29 -04:00
parent ff8f9c9332
commit 5328f145ef
1 changed files with 1 additions and 0 deletions

View File

@ -132,6 +132,7 @@ public class Cache<K, V> {
*/
protected long now() {
// System.nanoTime takes non-negligible time, so we only use it if we need it
// use System.nanoTime because we want relative time, not absolute time
return entriesExpireAfterAccess || entriesExpireAfterWrite ? System.nanoTime() : 0;
}