Calculate how long an Alert was active

Hi, I would like to know how long an alert was active, so from the Alert being sent to getting the OK alert again. I would like to display it on dashboard. Is this possible at all? I am using MySQL as a data source.