     }
     cycle = (cycle + 1) % 6000;
     ApplicationMonitor.IAmAlive();
+    unsigned long thisWatchTime = micros();
+    if(thisWatchTime > lastWatchTime) {
+      lastWatch = thisWatchTime - lastWatchTime;
+    } else {
+      lastWatch = 4294967295 - lastWatchTime + thisWatchTime;
+    }
+    lastWatchTime = thisWatchTime;
+    if(lastWatch > maxWatch) {
+      maxWatch = lastWatch;
+    }
     delay(100);
   }
 }

  startupDelay();
  
  ApplicationMonitor.EnableWatchdog(Watchdog::CApplicationMonitor::Timeout_8s);
    
  int cycle = 0;  
  http->LogMessage("Primary loop initialized");

    tap2->Loop(cycle);

    if(cycle % 600 == 0) {
      writeStatus(lastWatch, maxWatch);
    }
    if(cycle % 600 == 0) {
      http->Heartbeat();
