Clarify use of System.nanoTime for measuring eviction times
This commit is contained in:
parent
ff8f9c9332
commit
5328f145ef
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue