summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavej <davej>2003-06-09 22:02:35 +0000
committerdavej <davej>2003-06-09 22:02:35 +0000
commit0e7f481d13360e64e43c8384fc75a8207d01caab (patch)
treec0b5bd987b21948023f34cfde2bf3cd54425b07b
parent5b0778afa413c99a20fdfa40564f93c5fd5916e0 (diff)
* bench/MHz.c: Rounding up to nearest 50MHz if MHz is within a 15MHz
discrepancy of the nearest 50. Crap, needs improving.
-rw-r--r--ChangeLog3
-rw-r--r--bench/MHz.c9
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 65d7b65..954a8a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
Make the cachesize output look like it did in previous releases.
This is quite ugly, but is still a step forward to how I want it
to look one day.
+ * bench/MHz.c: Rounding up to nearest 50MHz if MHz is within a 15MHz
+ discrepancy of the nearest 50. Crap, needs improving.
+
2003-6-8 Bryan O'Sullivan <bos@serpentine.com>
diff --git a/bench/MHz.c b/bench/MHz.c
index 9f613e8..7bc4066 100644
--- a/bench/MHz.c
+++ b/bench/MHz.c
@@ -1,5 +1,5 @@
/*
- * $Id: MHz.c,v 1.2 2003/05/02 15:44:45 davej Exp $
+ * $Id: MHz.c,v 1.3 2003/06/09 22:02:36 davej Exp $
* This file is part of x86info.
* (C) 2001 Dave Jones.
*
@@ -86,6 +86,13 @@ void estimate_MHz(struct cpudata *cpu)
#endif /* __WIN32__ */
cpu->MHz = (int) (cycles[1]-cycles[0]) / (microseconds/freq);
+
+
+ if ((cpu->MHz % 50) > 15)
+ cpu->MHz = ((cpu->MHz / 50) * 50) + 50;
+ else
+ cpu->MHz = ((cpu->MHz / 50) * 50);
+
}
#ifdef __WIN32__