time between states metric

Surprised that ``_get_metadata`` clears the value. Wondering whether we shouldn't perhaps call this ``_reset_metadata`` instead (couldn't think of a great suggestion, but at least ``reset`` makes it obvious that the value is being cleared?