diff options
author | Can Erkin Acar <canacar@cvs.openbsd.org> | 2008-06-13 08:18:48 +0000 |
---|---|---|
committer | Can Erkin Acar <canacar@cvs.openbsd.org> | 2008-06-13 08:18:48 +0000 |
commit | e4dbef1bc11976efe92bf1ec3642bf2076c6c0ad (patch) | |
tree | 378497ce121bdcf66c25a9c74bd4555ab2e47ee5 | |
parent | 189552dcbfe0baf98c8e2d5a8951c5633064727e (diff) |
Use refresh interval for rate calculation instead of the broken elapsed
time computation.
-rw-r--r-- | usr.bin/systat/iostat.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/usr.bin/systat/iostat.c b/usr.bin/systat/iostat.c index da2b7b1f973..d9b24498cfe 100644 --- a/usr.bin/systat/iostat.c +++ b/usr.bin/systat/iostat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iostat.c,v 1.30 2008/06/12 22:26:01 canacar Exp $ */ +/* $OpenBSD: iostat.c,v 1.31 2008/06/13 08:18:47 canacar Exp $ */ /* $NetBSD: iostat.c,v 1.5 1996/05/10 23:16:35 thorpej Exp $ */ /* @@ -142,16 +142,7 @@ print_io(void) int n, count = 0; int i, curr; - - etime = 0.0; - for (i = 0; i < CPUSTATES; i++) - etime += cur.cp_time[i]; - - if (etime == 0.0) - etime = 1.0; - - etime /= (float) hz; - + etime = naptime; /* XXX engine internals: save and restore curr_line for bcache */ curr = curr_line; |