targetElement.element.setAttribute(TIME_ATTR,
DefaultLogger.formatTime(totalTime));
TimedElement parentElement = null;
Stack threadStack = getStack();
if (!threadStack.empty()) {
TimedElement poppedStack = (TimedElement) threadStack.pop();
if (poppedStack != targetElement) {
throw new RuntimeException("Mismatch - popped element = "
+ poppedStack.element + " finished target element = "
+ targetElement.element);