diff options
author | davej <davej> | 2003-06-09 22:02:35 +0000 |
---|---|---|
committer | davej <davej> | 2003-06-09 22:02:35 +0000 |
commit | 0e7f481d13360e64e43c8384fc75a8207d01caab (patch) | |
tree | c0b5bd987b21948023f34cfde2bf3cd54425b07b /bench | |
parent | 5b0778afa413c99a20fdfa40564f93c5fd5916e0 (diff) |
* bench/MHz.c: Rounding up to nearest 50MHz if MHz is within a 15MHz
discrepancy of the nearest 50. Crap, needs improving.
Diffstat (limited to 'bench')
-rw-r--r-- | bench/MHz.c | 9 |
1 files changed, 8 insertions, 1 deletions
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__ |