Footprint delta = new Footprint(baseFootprint); NumberFormat twoPlaces = NumberFormat.getInstance(Locale.ENGLISH); twoPlaces.setMinimumFractionDigits(2); twoPlaces.setMaximumFractionDigits(2); twoPlaces.setGroupingUsed(false); long cpuTime = delta.getCpuTime(); if (cpuTime >= 0) { xmlOutput.addAttribute("cpu_seconds", twoPlaces.format(cpuTime / 1000000000.0)); } long clockTime = delta.getClockTime(); if (clockTime >= 0) { xmlOutput.addAttribute("clock_seconds", twoPlaces.format(clockTime / 1000.0)); } long peakMemory = delta.getPeakMemory(); if (peakMemory >= 0) { xmlOutput.addAttribute("peak_mbytes", twoPlaces.format(peakMemory / (1024.0*1024))); }
	public void writeXML(XMLOutput xmlOutput) throws IOException {		xmlOutput.startTag("FindBugsSummary");				xmlOutput.addAttribute("timestamp",				new SimpleDateFormat(TIMESTAMP_FORMAT, Locale.ENGLISH).format(timestamp));		xmlOutput.addAttribute("total_classes", String.valueOf(totalClasses));		xmlOutput.addAttribute("total_bugs", String.valueOf(totalErrors[0]));		xmlOutput.addAttribute("total_size", String.valueOf(totalSize));		xmlOutput.addAttribute("num_packages", String.valueOf(packageStatsMap.size()));				PackageStats.writeBugPriorities(xmlOutput, totalErrors);				xmlOutput.stopTag(false);		for (PackageStats stats : packageStatsMap.values()) {			stats.writeXML(xmlOutput);		}				xmlOutput.closeTag("FindBugsSummary");	}