   PinManager::manager()->input_callbacks (user_command, user_interrupt);
 
   reset_all ();
-
-  last_millis = millis ();
 }
 
-void loop () {
-  unsigned long current_millis = millis ();
-  if (last_millis != current_millis) {
-    last_millis = current_millis;
-    // this code runs approximately every millisecond; delays may occur elsewhere
+void loop () { // approximately 178 loops per millisecond on the Uno when idling
+  time_check ();
+
+  if (time_flags & LOOPTIME_1ms) {
+    // ...
+    time_flags &= ~LOOPTIME_1ms;
+    return;
+  }
+
+  if (time_flags & LOOPTIME_10ms) {
+    // ...
+    time_flags &= ~LOOPTIME_10ms;
+    return;
+  }
+
+  if (time_flags & LOOPTIME_100ms) {
+    // ...
+    time_flags &= ~LOOPTIME_100ms;
+    return;
+  }
+
+  if (time_flags & LOOPTIME_1s) {
+#if 0
+    if (time_1s & 1)
+      Serial.print ("\r\ntick...");
+    else
+      Serial.print (" tock.");
+#endif
+    // ...
+    time_flags &= ~LOOPTIME_1s;
+    return;
   }
 
   input_check ();

void user_interrupt ();

void reset_all ();

static const char s_hello[] PROGMEM = "This is a simple 'hello' program. Just say 'hi'! (Type 'help all' for more options.)";

/* input_check() feeds any input back to user_command() via PinManager as an array of strings
 */

void reset_all () {
  print_pgm (s_hello);
  input_reset ();

  time_flags = 0;
  time_1ms = 0;
  time_10ms = 0;
  time_100ms = 0;
  time_1s = 0;

  last_millis = millis ();
}

void time_check () {
  unsigned long current_millis = millis ();

  if (last_millis != current_millis) { // this code runs approximately every millisecond; delays may occur elsewhere
    time_1ms += (current_millis - last_millis);
    last_millis = current_millis;
    
    /* every 1 ms
     */
    time_flags |= LOOPTIME_1ms;

    if (time_1ms >= 10) {
      time_1ms -= 10;
      ++time_10ms;

      /* every 10 ms
       */
      time_flags |= LOOPTIME_10ms;

      if (time_10ms >= 10) {
	time_10ms -= 10;
	++time_100ms;

	/* every 100 ms
	 */
	time_flags |= LOOPTIME_100ms;

	if (time_100ms >= 10) {
	  time_100ms -= 10;
	  ++time_1s;

	  /* every 1 s
	   */
	  time_flags |= LOOPTIME_1s;
	}
      }
    }
  }
}

void setup () {
  Serial.begin (115200);
