summaryrefslogtreecommitdiff
path: root/fps.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-01-18 17:14:52 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2017-01-18 17:31:44 -0800
commit524db0cf19648e3c7c78d3e73103b7a0bdcd6bfc (patch)
tree6fd682629904a210927797c92d956c208666b03a /fps.c
parentee2073d4e411555aba878277131b56f7eb562c84 (diff)
*: move source into src/ subdir
Restoring some organizational sanity since adopting autotools.
Diffstat (limited to 'fps.c')
-rw-r--r--fps.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/fps.c b/fps.c
deleted file mode 100644
index 99a3f85..0000000
--- a/fps.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <signal.h>
-#include <stdio.h>
-#include <sys/time.h>
-
-#include "fb.h"
-#include "util.h"
-
-
-static int print_fps;
-
-
-static void sigalrm_handler(int signum)
-{
- print_fps = 1;
-}
-
-
-int fps_setup(void)
-{
- struct itimerval interval = {
- .it_interval = { .tv_sec = 1, .tv_usec = 0 },
- .it_value = { .tv_sec = 1, .tv_usec = 0 },
- };
-
- if (signal(SIGALRM, sigalrm_handler) == SIG_ERR)
- return 0;
-
- if (setitimer(ITIMER_REAL, &interval, NULL) < 0)
- return 0;
-
- return 1;
-}
-
-
-void fps_print(fb_t *fb)
-{
- unsigned n;
-
- if (!print_fps)
- return;
-
- fb_get_put_pages_count(fb, &n);
- printf("FPS: %u\n", n);
-
- print_fps = 0;
-}
© All Rights Reserved