diff options
Diffstat (limited to 'stats.c')
-rw-r--r-- | stats.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/stats.c b/stats.c deleted file mode 100644 index 2232937..0000000 --- a/stats.c +++ /dev/null @@ -1,18 +0,0 @@ -#include <u.h> -#include <libc.h> -#include <draw.h> -#include "dat.h" -#include "fns.h" - -static double min(double a, double b) { return a < b? a: b; } -static double max(double a, double b) { return a > b? a: b; } - -void -statsupdate(Stats *s, double n) -{ - s->cur = n; - s->total += s->cur; - s->avg = s->total/++s->nupdates; - s->min = min(s->cur, s->min); - s->max = max(s->cur, s->max); -} |