Measuring angle on platform over long periods of time

Hi all, there was a much simpler solution to my problem:
As the roll period of the platform is know, I needed to delay the alarm with 1/2 of the roll period of the platform . When the timer exceeds the 1/2 roll period, i compare the angle to the critical angle. if the critical angle is exceeded i trigger alarm otherwise the timer gets reset.
For example
so if the roll period is 5sec. and the critical angle is set to 10 degrees, the platform is listing 8 deg, then wave hits the platform and let's say it rolls it to 12deg, when the roll angle reaches 10 deg the timer starts. I delay the alarm for 1/2 roll period or in this case 2.5 sec., which means that the platform is back at 8 deg and not exceeding the critical angle after the 1/2 roll period has past.
thank everyone for the posts