!7 cmodule WhenBooted > DynPrintLogAndEnabled { long value; double threshold = 2.0; // minimum difference in seconds that registers start { if (value != 0) printValue(); doEveryAndNow(5.0, r updateStuff); } void updateStuff enter { long newValue = computerBootTimestamp(); if (value == 0) { setField(value := newValue); printValue(); } else if (toSeconds(abs(value-newValue)) >= threshold) { print("COMPUTER BOOT TIME CHANGED!"); vmBus_send computerBootTimestampChanged(value, newValue); logQuotedWithDate(rebootLogFile(), "Boot timestamp changed from " + value + " to " + newValue); setField(value := newValue); printValue(); } } void printValue { print("Computer was booted: " + formatLocalDateWithSeconds(value)); } }