import java.math.*; import javax.imageio.*; import java.awt.image.*; import java.awt.event.*; import java.awt.*; import java.security.spec.*; import java.security.*; import java.lang.management.*; import java.lang.ref.*; import java.lang.reflect.*; import java.net.*; import java.io.*; import javax.swing.table.*; import javax.swing.text.*; import javax.swing.event.*; import javax.swing.*; import java.util.concurrent.atomic.*; import java.util.concurrent.*; import java.util.regex.*; import java.util.List; import java.util.zip.*; import java.util.*; public class main { static volatile long startedWatching, endedWatching; static volatile double currentValue, lastValue; static volatile double minValue = Double.MAX_VALUE, maxValue = Double.MIN_VALUE; static volatile double avgSum, deltaAvgSum; static volatile long avgCount, deltaAvgCount; static volatile long maxRuntime; static volatile long n; static volatile boolean actuallyEnded; public static void main(String[] args) throws Exception { Thread _t_0 = new Thread() { public void run() { try { print("Started watching."); startedWatching = now(); while (licensed()) { ++n; endedWatching = now(); currentValue = callIt(); long runtime = now()-endedWatching; if (n > 1) { deltaAvgSum += currentValue-lastValue; deltaAvgCount++; } lastValue = currentValue; if (runtime > maxRuntime) maxRuntime = runtime; if (currentValue < minValue) minValue = currentValue; if (currentValue > maxValue) maxValue = currentValue; avgCount++; avgSum += currentValue; sleepSeconds(1); // TODO: sleep until specific time } print("Done watching."); actuallyEnded = true; } catch (Exception _e) { throw _e instanceof RuntimeException ? (RuntimeException) _e : new RuntimeException(_e); } } }; _t_0.start(); } static double callIt() { return unixTime(); } static String html() { List l = new ArrayList(); for (String field : listFields(getMainClass())) { String value = "(Error getting value)"; try { value = structure(get(getMainClass(), field)); } catch (Throwable __e) { __e.printStackTrace(); } l.add(litmap("Field", field, "Value", value)); } return "
" + htmlEncode(cell) + " | \n"); buf.append("
---|
" + htmlEncode(cell) + " | \n"); buf.append("