int16_t time_is, time_mem1; loop() { time_is = (int16_t) millis(); // compare as "signed int" to get rid of glitches when the variable overflows if ((signed)(time_is-time_mem1-1000)>=0) { time_mem1 = time_is; // function below is executed every second my_display(); } }