#ifndef FRAMERATE_H
#define FRAMERATE_H

#include <stdlib.h>
#include <string.h>
#include <time.h>

typedef struct rat_frame_counter
{
	unsigned int framectr;
	float rate_period;
	clock_t oldclock;
	clock_t newclock;
	unsigned int fps;
	float normal_fps;
	float delta_time;
} rat_frame_counter;

#ifdef __cplusplus
extern "C" {
#endif

rat_frame_counter *rat_frame_counter_create(float normal_fps,float rate_period);
void rat_frame_counter_destroy(rat_frame_counter *ctr);

void rat_frame_counter_update(rat_frame_counter *ctr,unsigned int frames);

#ifdef __cplusplus
}
#endif

#endif
