Debian Codegraph @

pyinstrument/low_level/pyi_timing_thread.h

raw symbols SCIP
1 #ifndef PYI_TIMINGTHREAD_H
2 #define PYI_TIMINGTHREAD_H
3
4 #include <Python.h>
5 #include "pyi_shared.h"
6
7 /**
8 * Adds a subscription to the timing thread, requesting that it updates the
9 * time every `desired_interval` seconds. Returns an ID that can be used to
10 * unsubscribe later, or a negative value indicating error.
11 */
12
13 Py_EXPORTED_SYMBOL int pyi_timing_thread_subscribe(double desired_interval);
14
15 /**
16 * Returns the current time, as updated by the timing thread.
17 */
18 Py_EXPORTED_SYMBOL double pyi_timing_thread_get_time(void);
19
20 /**
21 * Returns the current interval, or -1 if the thread is not running.
22 */
23 Py_EXPORTED_SYMBOL double pyi_timing_thread_get_interval(void);
24
25 /**
26 * Unsubscribes from the timing thread. Returns 0 on success, or a negative
27 * value indicating error.
28 */
29 Py_EXPORTED_SYMBOL int pyi_timing_thread_unsubscribe(int id);
30
31 #define PYI_TIMING_THREAD_UNKNOWN_ERROR -1
32 #define PYI_TIMING_THREAD_TOO_MANY_SUBSCRIBERS -2
33 #define PYI_TIMING_THREAD_NOT_SUBSCRIBED -3
34
35 #endif /* PYI_TIMINGTHREAD_H */