@@ -0,0 +1,818 @@
+package com.haxademic.demo.system;%0A%0Aimport com.haxademic.core.app.P;%0Aimport com.haxademic.core.app.PAppletHax;%0Aimport com.haxademic.core.file.FileUtil;%0Aimport com.haxademic.core.math.Millis;%0Aimport com.haxademic.core.system.AppRestart;%0A%0Apublic class Demo_AppRestart_afterUptime%0Aextends PAppletHax %7B%0A%09public static void main(String args%5B%5D) %7B PAppletHax.main(Thread.currentThread().getStackTrace()%5B1%5D.getClassName()); %7D%0A%0A%09public void drawApp() %7B%0A%09%09p.background(0);%0A%09%09p.text(uptimeHours() + FileUtil.NEWLINE + P.hour() + %22:%22 + P.minute() + %22:%22 + P.second(), 20, 30);%0A%09%09%0A%09%09// restart if running for x hours and the local time is between 7-8pm%0A%09%09if(uptimeHours() %3E 0.01f && P.hour() %3E= 19 && P.hour() %3C 20) %7B%0A%09%09%09AppRestart.restart( p );%0A%09%09%7D%0A%09%7D%0A%09%0A%09protected float uptimeHours() %7B%0A%09%09return Millis.msToHours(p.millis());%0A%09%7D%0A%7D%0A

Add demo to restart within certain hours after a certain uptime