             }
         }
         
+        fuzzer.registerEventListener(for: fuzzer.events.InterestingProgramFound) { program in
+            self.lastInterestingProgramFound = Date()
+        }
+        
         // Do everything else after fuzzer initialization finished
         fuzzer.registerEventListener(for: fuzzer.events.Initialized) {
             if let stats = Statistics.instance(for: fuzzer) {

let Seconds = 1.0
let Minutes = 60.0 * Seconds
let Hours   = 60.0 * Minutes

// A very basic terminal UI.
class TerminalUI {
    // If set, the next program generated by the fuzzer will be printed to the screen.
    var printNextGeneratedProgram: Bool
    
    init(for fuzzer: Fuzzer) {
        printNextGeneratedProgram = false

        case .fuzzing:
            phase = "Fuzzing (with \(fuzzer.engine.name))"
        }
        
        let timeSinceLastInterestingProgram = -lastInterestingProgramFound.timeIntervalSinceNow
        let uptime = -startTime.timeIntervalSinceNow

        print("""
        Fuzzer Statistics
        -----------------
        Fuzzer phase:                 \(phase)
        Uptime:                       \(formatTimeInterval(uptime))
        Total Samples:                \(stats.totalSamples)
        \(interestingSamplesInfo)
        Last Interesting Sample:      \(formatTimeInterval(timeSinceLastInterestingProgram))
        Valid Samples Found:          \(stats.validSamples)
        Corpus Size:                  \(fuzzer.corpus.size)
        Correctness Rate:             \(String(format: "%.2f%%", stats.successRate * 100))
