Time on page capturing when sending requests in batch

Hi,

We have a desktop application which we would like to track using Matomo. One of the key stats that we would like to gatther is time that users spends on each page/action.

The issue is that sometimes application might be offline and we would only send data after the user terminates session and connects to the internet again.

So, the problem we are facing right now is that with HTTP requests we can send hh, mm, ss parameters for local time, however, the actual time in Matomo reports appear server side. This would create all data regarding time incorrect if it will be send in batch.

Any workarounds/fixes here? Maybe sending time/duration values in custom dimension?