title: monitor the value of a variable for some time
body: <p>I am measuring the power value of a phase of a system from a meter via serial rtu modbus communication.
  I'm trying to write a code that allows me to monitor the power value within a certain value, for example + - 5%. If the instantaneous power value read remains within that range of values ​​for 15 min then I take it as valid data, otherwise if before the expiry of the 15 minutes this value leaves that range I must reset the timer to 15. 
  if you know any library that monitors the value of the variables it would be very useful to me. 
  Thanks</p>