summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
Diffstat (limited to 'bench')
-rw-r--r--bench/MHz.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/bench/MHz.c b/bench/MHz.c
index 53c11f1..1cb4697 100644
--- a/bench/MHz.c
+++ b/bench/MHz.c
@@ -15,6 +15,18 @@
#include "../x86info.h"
#include "bench.h"
+void display_MHz(struct cpudata *cpu)
+{
+ if (cpu->MHz < 1000)
+ printf("%uMHz", cpu->MHz);
+ else {
+ int a = (cpu->MHz / 1000);
+ int b = ((cpu->MHz % 1000)/100);
+ int c = (a*1000)+(b*100);
+ printf("%u.%u%uGHz", a, b, (cpu->MHz - c)/10);
+ }
+}
+
static volatile int nosignal = 0;
static void sighandler(int sig __attribute__((unused)))