mirror of
https://github.com/Harshit-Dhanwalkar/AsciiCam.git
synced 2026-06-27 11:09:38 +02:00
Add FPS rendering on top
This commit is contained in:
parent
9eaf33ea36
commit
8a79d2fece
6 changed files with 146 additions and 70 deletions
|
|
@ -3,9 +3,19 @@
|
|||
|
||||
#include <time.h>
|
||||
|
||||
typedef struct {
|
||||
long samples[16]; // frame duration (ns) ring buffer
|
||||
int head;
|
||||
int count;
|
||||
} fps_counter_t;
|
||||
|
||||
// Initialize framerate control
|
||||
void timing_init(int fps);
|
||||
|
||||
void timing_sleep(struct timespec *start_time);
|
||||
|
||||
void fps_push(fps_counter_t *fc, long elapsed_ns);
|
||||
|
||||
double fps_get(const fps_counter_t *fc);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue