diff options
author | Dave Jones <davej@redhat.com> | 2011-02-22 17:04:10 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2011-02-22 17:04:10 -0500 |
commit | 1de61070745303b2132e774393ef229587bc821a (patch) | |
tree | e23f18f92a3282b7c31d915cf4a318a949f9da06 /bench | |
parent | 7f9bc83b7b955370350d842195dfeb17e61e192b (diff) |
move MHz display to mhz.c
Diffstat (limited to 'bench')
-rw-r--r-- | bench/MHz.c | 12 |
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))) |