title: duration between 2 states
body: <p>I am building an app in which whenever the widget state changes I want to set a background timer so when the state changes again I can get the last widget state time (i.e. duration between 2 states).</p>