The implementation should not be much different from SSHTerminal.connection_lost except that the time is measured.