/** List all captured data. */ public static void list() { if (MAIN.lastIndex == 0) { // don't list anything if no statistics collected return; } try { MAIN.listUnvisited(); MAIN.listTop("MOST CALLED", MAIN.count, top); MAIN.listTop("MOST TIME USED", MAIN.time, top); } catch (Exception e) { e.printStackTrace(); } }
/** Start collecting data. */ public static void startCollecting() { MAIN.stop = false; MAIN.lastTime = System.currentTimeMillis(); }
/** Stop collecting data. */ public static void stopCollecting() { MAIN.stop = true; }
/** * This method is called by an instrumented application whenever a line of code is executed. * * @param i the line number that is executed */ public static void visit(int i) { MAIN.addVisit(i); }