awatcher icon indicating copy to clipboard operation
awatcher copied to clipboard

Don't round duration

Open powellnorma opened this issue 1 year ago • 0 comments

If the title changes every second, this watcher sends data to the server, but the duration is 0.

Reproducible via:

let count = 0;

function updateTitle() {
  count++;
  document.title = `Count: ${count}`;
}

setInterval(updateTitle, 1000);

Hm ok, the issue seems to not be related to rounding, but to duration of last event not being updated before new one get's created, so it stays at initial value (zero):

https://github.com/2e3s/awatcher/blob/a04578083f071ee9731e11d2a61f3ae9c548fd81/watchers/src/report_client.rs#L122

powellnorma avatar Oct 06 '24 14:10 powellnorma