Timer using a boolean OPC tag

Hello I need to do a timer, using a boolean OPC tag so when it turns on it starts counting the time it lasts on

You can just capture the timestamp of when the tag value changed with a tag change script, and compare that to now