plibsys 0.0.5
|
Time profiler. More...
Go to the source code of this file.
Typedefs | |
typedef struct PTimeProfiler_ | PTimeProfiler |
Time profiler opaque data structure. | |
Functions | |
P_LIB_API PTimeProfiler * | p_time_profiler_new (void) |
Creates a new PTimeProfiler object. | |
P_LIB_API void | p_time_profiler_reset (PTimeProfiler *profiler) |
Resets the PTimeProfiler's internal counter to zero. | |
P_LIB_API puint64 | p_time_profiler_elapsed_usecs (const PTimeProfiler *profiler) |
Calculates elapsed time since the last reset or creation. | |
P_LIB_API void | p_time_profiler_free (PTimeProfiler *profiler) |
Frees PTimeProfiler object. | |
Time profiler.
PTimeProfiler acts like a time chronometer: in any moment of time you can make a time slice to see how much time elapsed since the last slice or timer start.
This profiler is useful to gather information about execution time for calls or parts of the code. It can help to leverage bottle-necks in your code.
To start using a profiler create a new one with p_time_profiler_new() call and p_time_profiler_elapsed_usecs() to get elapsed time since the creation. If you need to reset a profiler use p_time_profiler_reset(). Remove a profiler with p_time_profiler_free().
Definition in file ptimeprofiler.h.
typedef struct PTimeProfiler_ PTimeProfiler |
Time profiler opaque data structure.
Definition at line 57 of file ptimeprofiler.h.
P_LIB_API puint64 p_time_profiler_elapsed_usecs | ( | const PTimeProfiler * | profiler | ) |
Calculates elapsed time since the last reset or creation.
profiler | Time profiler to calculate elapsed time for. |
P_LIB_API void p_time_profiler_free | ( | PTimeProfiler * | profiler | ) |
P_LIB_API PTimeProfiler * p_time_profiler_new | ( | void | ) |
Creates a new PTimeProfiler object.
P_LIB_API void p_time_profiler_reset | ( | PTimeProfiler * | profiler | ) |
Resets the PTimeProfiler's internal counter to zero.
profiler | Time profiler to reset. |
After a reset the time profiler begins to count elapsed time from that moment of time.