*
* $Id$
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "timestats.h"
/* Initialize a timestat_t struct */
time_stat_init(timestat_t *stats)
{
stats->num = 0;
- stats->min.secs = 0;
- stats->min.nsecs = 0;
- stats->max.secs = 0;
- stats->max.nsecs = 0;
- stats->tot.secs = 0;
- stats->tot.nsecs = 0;
+ stats->min_num = 0;
+ stats->max_num = 0;
+ nstime_set_zero(&stats->min);
+ nstime_set_zero(&stats->max);
+ nstime_set_zero(&stats->tot);
+ stats->variance = 0.0;
}
/* Update a timestat_t struct with a new sample */
stats->max_num=pinfo->fd->num;
}
- addtime(&stats->tot, delta);
+ nstime_add(&stats->tot, delta);
stats->num++;
}