| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
time_util.h
Go to the documentation of this file.
1
10#ifndef __TIME_UTIL_H__
11#define __TIME_UTIL_H__
12
13#include <wireshark.h>
14#include <time.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
29WS_DLL_PUBLIC
30time_t mktime_utc(struct tm *tm);
31
42WS_DLL_PUBLIC
43bool tm_is_valid(struct tm *tm);
44
54WS_DLL_PUBLIC
55void get_resource_usage(double *user_time, double *sys_time);
56
67WS_DLL_PUBLIC
68void log_resource_usage(bool reset_delta, const char *format, ...);
69
78WS_DLL_PUBLIC
79uint64_t create_timestamp(void);
80
87WS_DLL_PUBLIC
88void ws_tzset(void);
89
98WS_DLL_PUBLIC
99struct timespec *ws_clock_get_realtime(struct timespec *ts);
100
111WS_DLL_PUBLIC
112struct tm *ws_localtime_r(const time_t *timep, struct tm *result);
113
124WS_DLL_PUBLIC
125struct tm *ws_gmtime_r(const time_t *timep, struct tm *result);
126
127#ifdef __cplusplus
128}
129#endif /* __cplusplus */
130
131#endif /* __TIME_UTIL_H__ */
mktime_utc
WS_DLL_PUBLIC time_t mktime_utc(struct tm *tm)
Converts a UTC-based broken-down time to a timestamp.
Definition time_util.c:35
get_resource_usage
WS_DLL_PUBLIC void get_resource_usage(double *user_time, double *sys_time)
Retrieves the current process CPU usage.
Definition time_util.c:153
tm_is_valid
WS_DLL_PUBLIC bool tm_is_valid(struct tm *tm)
Validates the fields of a broken-down time structure.
Definition time_util.c:124
ws_localtime_r
WS_DLL_PUBLIC struct tm * ws_localtime_r(const time_t *timep, struct tm *result)
Converts a time value to local time.
Definition time_util.c:284
ws_clock_get_realtime
WS_DLL_PUBLIC struct timespec * ws_clock_get_realtime(struct timespec *ts)
Retrieves the current real-time clock value.
Definition time_util.c:258
ws_gmtime_r
WS_DLL_PUBLIC struct tm * ws_gmtime_r(const time_t *timep, struct tm *result)
Converts a time value to UTC (GMT).
Definition time_util.c:310
ws_tzset
WS_DLL_PUBLIC void ws_tzset(void)
Initializes or updates timezone settings.
Definition time_util.c:302
log_resource_usage
WS_DLL_PUBLIC void log_resource_usage(bool reset_delta, const char *format,...)
Logs the process CPU usage along with a formatted message.
Definition time_util.c:180
create_timestamp
WS_DLL_PUBLIC uint64_t create_timestamp(void)
Fetches the number of microseconds since the Unix epoch.
Definition time_util.c:208