mc/lib/timer.h
Andrew Borodin 62faec3a61 Ticket #2136: implement user-friendly interruption of long-time operations.
Initial step: created a simple timer.

Unlike GTimer, mc timer doesn't use a lot of multiplications and
divisions to convert seconds to nanoseconds and back. mc timer use only
multiplications to convert seconds to microseconds.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:40:30 +04:00

28 lines
887 B
C

/** \file timer.h
* \brief Header: simple timer
*/
#ifndef MC_TIMER_H
#define MC_TIMER_H
/*** typedefs(not structures) and defined constants **********************************************/
/*** enums ***************************************************************************************/
/*** structures declarations (and typedefs of structures)*****************************************/
struct mc_timer_t;
typedef struct mc_timer_t mc_timer_t;
/*** global variables defined in .c file *********************************************************/
/*** declarations of public functions ************************************************************/
mc_timer_t *mc_timer_new (void);
void mc_timer_destroy (mc_timer_t * timer);
guint64 mc_timer_elapsed (const mc_timer_t * timer);
/*** inline functions **************************************************/
#endif /* MC_TIMER_H */