awatcher
awatcher copied to clipboard
Don't round duration
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