From 35b7526e0655522bbdf92f6384f4e9dff74f38a0 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 20 Sep 2021 10:59:21 -0400 Subject: [PATCH] supposedly handle >1000hz From https://gist.github.com/Sporif/314d5796e48ff0e9f63ec5b89f967b66 I don't have a > 1000hz mouse to be sure. --- evhz.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evhz.c b/evhz.c index 3b4d0cf..c7ba33d 100644 --- a/evhz.c +++ b/evhz.c @@ -118,13 +118,13 @@ int main(int argc, char *argv[]) { unsigned long long time, timediff; unsigned hz = 0; - time = (unsigned long long)event.time.tv_sec * 1000ULL; - time += (unsigned long long)event.time.tv_usec / 1000ULL; + time = (unsigned long long)event.time.tv_sec * 1000000ULL; + time += (unsigned long long)event.time.tv_usec; timediff = time - events[i].prev_time; if(timediff != 0) - hz = 1000ULL / timediff; + hz = 1000000ULL / timediff; if(hz > 0) { unsigned j, maxavg; -- 2.30.2