2 * Routines and definitions for time statistics
3 * Copyright 2003 Lars Roland
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __TIMESTATS_H__
13 #define __TIMESTATS_H__
15 #include "epan/packet_info.h"
16 #include "wsutil/nstime.h"
20 #endif /* __cplusplus */
22 /* Summary of time statistics*/
23 typedef struct _timestat_t
{
24 uint32_t num
; /* number of samples */
25 uint32_t min_num
; /* frame number of minimum */
26 uint32_t max_num
; /* frame number of maximum */
35 /* Initialize a timestat_t struct */
36 WS_DLL_PUBLIC
void time_stat_init(timestat_t
*stats
);
38 /* Update a timestat_t struct with a new sample */
39 WS_DLL_PUBLIC
void time_stat_update(timestat_t
*stats
, const nstime_t
*delta
, packet_info
*pinfo
);
41 WS_DLL_PUBLIC
double get_average(const nstime_t
*sum
, uint32_t num
);
45 #endif /* __cplusplus */
47 #endif /* __TIMESTATS_H__ */