FreeRDP
Loading...
Searching...
No Matches
stopwatch.h
1
20#ifndef FREERDP_UTILS_STOPWATCH_H
21#define FREERDP_UTILS_STOPWATCH_H
22
23#include <freerdp/api.h>
24#include <freerdp/types.h>
25
26#ifdef __cplusplus
27extern "C"
28{
29#endif
30
31 typedef struct
32 {
33 UINT64 start;
34 UINT64 end;
35 UINT64 elapsed;
36 UINT32 count;
37 } STOPWATCH;
38
39 FREERDP_API void stopwatch_free(STOPWATCH* stopwatch);
40
41 WINPR_ATTR_MALLOC(stopwatch_free, 1)
42 WINPR_ATTR_NODISCARD
43 FREERDP_API STOPWATCH* stopwatch_create(void);
44
45 FREERDP_API void stopwatch_start(STOPWATCH* stopwatch);
46 FREERDP_API void stopwatch_stop(STOPWATCH* stopwatch);
47 FREERDP_API void stopwatch_reset(STOPWATCH* stopwatch);
48
49 WINPR_ATTR_NODISCARD
50 FREERDP_API double stopwatch_get_elapsed_time_in_seconds(STOPWATCH* stopwatch);
51 FREERDP_API void stopwatch_get_elapsed_time_in_useconds(STOPWATCH* stopwatch, UINT32* sec,
52 UINT32* usec);
53
54#ifdef __cplusplus
55}
56#endif
57
58#endif /* FREERDP_UTILS_STOPWATCH_H */