Basically, I need to compare two variables and start the timer when conditions met and set a variable to true if the condition sustains a certain amount of time. ( Similar to TON timer in PLC programming)
Example:
if a > b sustains for 5 seconds, then set c = true, otherwise set c = false