~iank/evhz

35b7526e0655522bbdf92f6384f4e9dff74f38a0 — Ian Kelling 8 months ago 2c94d6f master
supposedly handle >1000hz

From
https://gist.github.com/Sporif/314d5796e48ff0e9f63ec5b89f967b66
I don't have a > 1000hz mouse to be sure.
1 files changed, 3 insertions(+), 3 deletions(-)

M evhz.c
M evhz.c => evhz.c +3 -3
@@ 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;