rofi/include/timings.h

72 lines
1.4 KiB
C
Raw Normal View History

2015-11-14 12:49:42 +00:00
#ifndef ROFI_TIMINGS_H
#define ROFI_TIMINGS_H
#include <config.h>
2016-01-07 07:54:24 +00:00
/**
* @defgroup TIMINGS Timings
* @ingroup HELPERS
* @{
*/
2015-11-14 12:49:42 +00:00
#if TIMINGS
2016-10-15 13:39:08 +00:00
/**
* Init the timestamping mechanism .
* implementation.
*/
2015-11-14 12:49:42 +00:00
void rofi_timings_init ( void );
2016-10-15 13:39:08 +00:00
/**
* @param str function name.
* @param line line number
* @param msg message
*
* Report a tick.
*/
2016-10-31 07:07:02 +00:00
void rofi_timings_tick ( const char *file, char const *str, int line, char const *msg );
2016-10-15 13:39:08 +00:00
/**
* Stop the timestamping mechanism
*/
2015-11-14 12:49:42 +00:00
void rofi_timings_quit ( void );
2016-10-15 13:39:08 +00:00
/**
* Start timestamping mechanism.
* Call to this function is time 0.
*/
2015-11-24 21:53:40 +00:00
#define TIMINGS_START() rofi_timings_init ()
2016-10-15 13:39:08 +00:00
/**
* Report current time since TIMINGS_START
*/
2016-10-31 07:07:02 +00:00
#define TICK() rofi_timings_tick ( __FILE__, __func__, __LINE__, "" )
2016-10-15 13:39:08 +00:00
/**
* @param a an string
* Report current time since TIMINGS_START
*/
2016-10-31 07:07:02 +00:00
#define TICK_N( a ) rofi_timings_tick ( __FILE__, __func__, __LINE__, a )
2016-10-15 13:39:08 +00:00
/**
* Stop timestamping mechanism.
*/
2015-11-24 21:53:40 +00:00
#define TIMINGS_STOP() rofi_timings_quit ()
2015-11-14 12:49:42 +00:00
#else
2016-10-15 13:39:08 +00:00
/**
* Start timestamping mechanism.
* Call to this function is time 0.
*/
2015-11-14 12:49:42 +00:00
#define TIMINGS_START()
2016-10-15 13:39:08 +00:00
/**
* Stop timestamping mechanism.
*/
2015-11-14 12:49:42 +00:00
#define TIMINGS_STOP()
2016-10-15 13:39:08 +00:00
/**
* Report current time since TIMINGS_START
*/
2015-11-14 12:49:42 +00:00
#define TICK()
2016-10-15 13:39:08 +00:00
/**
* @param a an string
* Report current time since TIMINGS_START
*/
2015-11-14 12:49:42 +00:00
#define TICK_N( a )
#endif // TIMINGS
2016-01-07 07:54:24 +00:00
/*@}*/
2015-11-14 12:49:42 +00:00
#endif // ROFI_TIMINGS_H