X-Git-Url: https://iankelling.org/git/?p=evhz;a=blobdiff_plain;f=evhz.c;h=4fd770dadc8e30ce843c5f1b8fb585c5ff2686d2;hp=3b4d0cf0bd5e79b64769a8b9753be2a388387b5b;hb=HEAD;hpb=2c94d6f23d7ee360d422101ce84df8ee01509f9e diff --git a/evhz.c b/evhz.c index 3b4d0cf..950f727 100644 --- a/evhz.c +++ b/evhz.c @@ -1,3 +1,9 @@ +/* The license of this program follows the GNU license recommendations at */ +/* https://www.gnu.org/licenses/license-recommendations.en.html. They */ +/* recommend that small programs, < 300 lines, be licensed under the */ +/* Apache License 2.0. This file contains or is part of one or more small */ +/* programs. */ + /* Copyright (C) 2016 Ian Kelling */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -118,13 +124,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;