Il secondo orologio indica da quanto tempo รจ partita l’applicazione tramite il metodo millis().
PFont FONT; float testoY; float testoX1, testoX2, testoX3, testoX6, testoX7, testoX8; void setup() { size(500, 50); frameRate(5); FONT=loadFont("C48.vlw"); textFont(FONT); textAlign(CENTER); testoX1 =width/10; testoX2 = 2.5*testoX1; testoX3 = 4*testoX1; testoX6 = 6*testoX1; testoX7 = 7.5*testoX1; testoX8 = 9*testoX1; testoY=0.8*height; } void draw() { background(200); fill( 0, 0, 255); text(nf(hour(), 2), testoX1, testoY); fill(255, 0, 255); text(nf(minute(), 2), testoX2, testoY); fill(255, 0, 0); text(nf(second(), 2), testoX3, testoY); int mm=millis(); int s=mm/1000; int m=s/60; s=s%60; int h=m/60; m=m%60; fill( 0, 0, 255); text(nf(h, 2), testoX6, testoY); fill(255, 0, 255); text(nf(m, 2), testoX7, testoY); fill(255, 0, 0); text(nf(s, 2), testoX8, testoY); }