Store actual user "contact time" in Historic User Tasks

I have a requirement to report how much time a user spends completing a form associated to a User Task. This is different from the Task duration, since the user might not work on the form right after the task is started.

What I am thinking is measuring the duration while the form is being displayed, and then submitting this duration as part of the complete task call. Is there a better way?

Also, what is the best way to store this duration? I could store it as part of the task variables, but I am wondering if there is a better way. In particular a way of making this information a first-class field of a historical task that one could use in queries, the same way the current “duration” based on start and end times is used.

Thank you.