use nanoTime instead of millis

This commit is contained in:
Shay Banon 2012-05-01 11:59:02 +03:00
parent f7c9dd11e9
commit ef94cc0517
1 changed files with 3 additions and 3 deletions

View File

@ -121,12 +121,12 @@ public abstract class AbstractConcurrentMapFieldDataCache extends AbstractIndexC
fieldData = fieldDataCache.getIfPresent(fieldName);
if (fieldData == null) {
try {
long time = System.currentTimeMillis();
long time = System.nanoTime();
fieldData = FieldData.load(type, reader, fieldName);
fieldDataCache.put(fieldName, fieldData);
long took = System.currentTimeMillis() - time;
long took = System.nanoTime() - time;
if (logger.isTraceEnabled()) {
logger.trace("loaded field [{}] for reader [{}], took [{}], took_millis [{}]", fieldName, reader, TimeValue.timeValueMillis(took), took);
logger.trace("loaded field [{}] for reader [{}], took [{}], took_millis [{}]", fieldName, reader, TimeValue.timeValueNanos(took), took / 1000);
}
} catch (OutOfMemoryError e) {
logger.warn("loading field [" + fieldName + "] caused out of memory failure", e);