improve license notice
[evhz] / evhz.c
diff --git a/evhz.c b/evhz.c
index 3b4d0cf0bd5e79b64769a8b9753be2a388387b5b..950f727fcc6a7cd379fc76e153420878bfed6208 100644 (file)
--- 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;