mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 21:06:52 +03:00
62faec3a61
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>
28 lines
887 B
C
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 */
|