static AutoCloseable profileThisThreadToConsole() { int interval = 5000, firstInterval = 1000; final Thread t = currentThread(); ret timerAsAutocloseable(doEvery_daemon(interval, firstInterval, r { print("\nStack trace."); print(lines(asList(t.getStackTrace()))); })); } static A profileThisThreadToConsole(IF0 f) { if (f == null) null; temp profileThisThreadToConsole(); ret f!; } svoid profileThisThreadToConsole(Runnable r) { if (r == null) ret; temp profileThisThreadToConsole(); r.run(); }