+ static unsigned long last_utime;
+ static int fd;
+ unsigned long utime, ret;
+ char buf[128];
+
+ if (fd == 0)
+ fd = open("/proc/self/stat", O_RDONLY);
+ lseek(fd, 0, SEEK_SET);
+ buf[0] = 0;
+ read(fd, buf, sizeof(buf));
+ buf[sizeof(buf) - 1] = 0;
+
+ sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %lu", &utime);
+ ret = utime - last_utime;
+ last_utime = utime;
+ return ret;
+}
+
+static void print_fps(void)
+{
+ if (pl_fbdev_bpp == 16)
+ pl_text_out16(2, pl_fbdev_h - 10, "%2d %4.1f", flips_per_sec, fps_cur);
+}
+
+static void print_cpu_usage(void)
+{
+ if (pl_fbdev_bpp == 16)
+ pl_text_out16(pl_fbdev_w - 28, pl_fbdev_h - 10, "%3d", tick_per_sec);