From: Ian Kelling Date: Mon, 20 Sep 2021 14:59:21 +0000 (-0400) Subject: supposedly handle >1000hz X-Git-Url: https://iankelling.org/git/?p=evhz;a=commitdiff_plain;h=35b7526e0655522bbdf92f6384f4e9dff74f38a0 supposedly handle >1000hz From https://gist.github.com/Sporif/314d5796e48ff0e9f63ec5b89f967b66 I don't have a > 1000hz mouse to be sure. --- 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;