Keep track of "the last time we were verifiably online"
We need a very efficient way to keep track of when we were last verifiably online.
In our parlance, we count as "verifiably online" whenever we successfully complete a TLS handshake with a remote address, or read read data from a remote TLS stream.
This mechanism needs to be "very efficient" because even fast timer mechanisms can be too slow if we're calling them on every read. Note that this mechanism doesn't need to be very accurate, however: we don't need more than a couple of seconds of resolution here.
tor-guardmgr
want this information, and other diagnostic tools may as well.
f30b2280 was a commit (now reverted) that added a mechanism sort of like this.