/// Global Variables //SimpleDateFormat stampFormat = new SimpleDateFormat("yyyyMMdd-HHmmss"); //TimeZone stampTimeZone = TimeZone.getTimeZone("GMT"); //stampFormat.setTimeZone(stampTimeZone); int liveModeDuration = 5; // Standard Java fails: Date timeLapseRecent = new Date(); int ageLapseRecent = int(timeLapseRecent.getTime()/1000); // Messy workaround: This produces no Unix Epoch Timestamp, but at least a dirty timestamp, relative to the beginning of the current month, which helped back then to realise my project, which only had to ran in exhibition for a few weeks and hence it was enough. //int ageLapseRecent = (month()*30*24*60*60)+(day()*24*60*60)+(hour()*60*60)+(minute()*60)+(second()*1); /// Setup Function void setup() { size(200, 200); background(0); loop(); // noLoop() or loop() frameRate(1); } /// Main Loop void draw() { // Standard Java fails: // int devNull = second(); // Pseudo query to a Processing core timing function, maybe this refreshes the Standard Java Date() object functionality. No, sadly not! Date timeNow = new Date(); int ageNow = int(timeNow.getTime()/1000); // Messy workaround: // int ageNow = (month()*30*24*60*60)+(day()*24*60*60)+(hour()*60*60)+(minute()*60)+(second()*1); int timeDuration = ageNow - ageLapseRecent; println("Last Time Lapse: " + ageLapseRecent + ". Now: " + ageNow + ". Time since last TimeLapse: " + timeDuration); if (timeDuration >= liveModeDuration) { ageLapseRecent = ageNow; println("Simulation: Live Mode is over, switching to Time Lapse Mode."); } }