1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-11 13:50:48 -05:00
rofi/include/timings.h

99 lines
2.5 KiB
C
Raw Normal View History

/*
* rofi
*
* MIT/X11 License
* Copyright © 2013-2017 Qball Cow <qball@gmpclient.org>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
2015-11-14 07:49:42 -05:00
#ifndef ROFI_TIMINGS_H
#define ROFI_TIMINGS_H
#include <config.h>
2016-01-07 02:54:24 -05:00
/**
* @defgroup TIMINGS Timings
* @ingroup HELPERS
* @{
*/
#ifdef TIMINGS
2016-10-15 09:39:08 -04:00
/**
* Init the timestamping mechanism .
* implementation.
*/
2015-11-14 07:49:42 -05:00
void rofi_timings_init ( void );
2016-10-15 09:39:08 -04:00
/**
* @param str function name.
* @param line line number
* @param msg message
*
* Report a tick.
*/
2016-10-31 03:07:02 -04:00
void rofi_timings_tick ( const char *file, char const *str, int line, char const *msg );
2016-10-15 09:39:08 -04:00
/**
* Stop the timestamping mechanism
*/
2015-11-14 07:49:42 -05:00
void rofi_timings_quit ( void );
2016-10-15 09:39:08 -04:00
/**
* Start timestamping mechanism.
* Call to this function is time 0.
*/
2015-11-24 16:53:40 -05:00
#define TIMINGS_START() rofi_timings_init ()
2016-10-15 09:39:08 -04:00
/**
* Report current time since TIMINGS_START
*/
2016-10-31 03:07:02 -04:00
#define TICK() rofi_timings_tick ( __FILE__, __func__, __LINE__, "" )
2016-10-15 09:39:08 -04:00
/**
* @param a an string
* Report current time since TIMINGS_START
*/
2016-10-31 03:07:02 -04:00
#define TICK_N( a ) rofi_timings_tick ( __FILE__, __func__, __LINE__, a )
2016-10-15 09:39:08 -04:00
/**
* Stop timestamping mechanism.
*/
2015-11-24 16:53:40 -05:00
#define TIMINGS_STOP() rofi_timings_quit ()
2015-11-14 07:49:42 -05:00
#else
2016-10-15 09:39:08 -04:00
/**
* Start timestamping mechanism.
* Call to this function is time 0.
*/
2015-11-14 07:49:42 -05:00
#define TIMINGS_START()
2016-10-15 09:39:08 -04:00
/**
* Stop timestamping mechanism.
*/
2015-11-14 07:49:42 -05:00
#define TIMINGS_STOP()
2016-10-15 09:39:08 -04:00
/**
* Report current time since TIMINGS_START
*/
2015-11-14 07:49:42 -05:00
#define TICK()
2016-10-15 09:39:08 -04:00
/**
* @param a an string
* Report current time since TIMINGS_START
*/
2015-11-14 07:49:42 -05:00
#define TICK_N( a )
#endif // TIMINGS
2016-01-07 02:54:24 -05:00
/*@}*/
2015-11-14 07:49:42 -05:00
#endif // ROFI_TIMINGS_H