+/* 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"); */
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;