use of lucee.runtime.debug.DebugEntryTemplate in project Lucee by lucee.
the class ComponentLoader method loadPage.
public static Page loadPage(PageContext pc, PageSource ps, boolean forceReload) throws PageException {
if (pc.getConfig().debug()) {
DebugEntryTemplate debugEntry = pc.getDebugger().getEntry(pc, ps);
pc.addPageSource(ps, true);
long currTime = pc.getExecutionTime();
long exeTime = 0;
long time = System.currentTimeMillis();
try {
debugEntry.updateFileLoadTime((int) (System.currentTimeMillis() - time));
exeTime = System.currentTimeMillis();
return ps.loadPage(pc, forceReload);
} finally {
long diff = ((System.currentTimeMillis() - exeTime) - (pc.getExecutionTime() - currTime));
pc.setExecutionTime(pc.getExecutionTime() + (System.currentTimeMillis() - time));
debugEntry.updateExeTime(diff);
pc.removeLastPageSource(true);
}
}
// no debug
pc.addPageSource(ps, true);
try {
return ps.loadPage(pc, forceReload);
} finally {
pc.removeLastPageSource(true);
}
}
Aggregations