AsciiCam/C/include/timing.h

22 lines
379 B
C
Raw Permalink Normal View History

2026-05-13 22:18:22 +05:30
#ifndef TIMING_H
#define TIMING_H
#include <time.h>
2026-05-24 17:13:03 +05:30
typedef struct {
long samples[16]; // frame duration (ns) ring buffer
int head;
int count;
} fps_counter_t;
2026-05-13 22:18:22 +05:30
// Initialize framerate control
void timing_init(int fps);
void timing_sleep(struct timespec *start_time);
2026-05-24 17:13:03 +05:30
void fps_push(fps_counter_t *fc, long elapsed_ns);
double fps_get(const fps_counter_t *fc);
2026-05-13 22:18:22 +05:30
#endif