Found my online stats calc code. It's in C but I can rework it. This should work better for FPS calc.

This commit is contained in:
Zed A. Shaw 2025-01-18 00:53:10 -05:00
parent 7a74877849
commit e3e0f0a322
2 changed files with 90 additions and 0 deletions

25
stats.h Normal file
View file

@ -0,0 +1,25 @@
#ifndef lcthw_stats_h
#define lcthw_stats_h
typedef struct Stats {
double sum;
double sumsq;
unsigned long n;
double min;
double max;
} Stats;
Stats *Stats_recreate(double sum, double sumsq, unsigned long n,
double min, double max);
Stats *Stats_create();
double Stats_mean(Stats * st);
double Stats_stddev(Stats * st);
void Stats_sample(Stats * st, double s);
void Stats_dump(Stats * st);
#endif