nexmon – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /* time_util.h
2 *
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21  
22 #ifndef __TIME_UTIL_H__
23 #define __TIME_UTIL_H__
24  
25 #include "ws_symbol_export.h"
26  
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30  
31 #include <time.h>
32  
33 WS_DLL_PUBLIC
34 time_t mktime_utc(struct tm *tm);
35  
36 /** Fetch the process CPU time.
37 *
38 * Fetch the current process user and system CPU times, convert them to
39 * seconds, and store them in the provided parameters.
40 *
41 * @param user_time Seconds spent in user mode.
42 * @param sys_time Seconds spent in system (kernel) mode.
43 */
44 WS_DLL_PUBLIC
45 void get_resource_usage(double *user_time, double *sys_time);
46  
47 /** Print the process CPU time followed by a log message.
48 *
49 * Print the current process user and system CPU times along with the times
50 * elapsed since the times were last reset.
51 *
52 * @param reset_delta Reset the delta times. This will typically be TRUE when
53 * logging the first measurement and FALSE thereafter.
54 * @param format Printf-style format string. Passed to g_string_vprintf.
55 * @param ... Parameters for the format string.
56 */
57 WS_DLL_PUBLIC
58 void log_resource_usage(gboolean reset_delta, const char *format, ...);
59  
60 #ifdef __cplusplus
61 }
62 #endif /* __cplusplus */
63  
64 #endif /* __TIME_UTIL_H__ */