[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#1029: kpm shows wrong cputime values
From:       "Dirk A. Mueller" <dmuell () gmx ! net>
Date:       1999-03-20 17:08:14
[Download RAW message or body]


Package: kpm
Version: KDE 1.1 (1.3k4)

kpm, part of kdeutils v1.1 shows a wrong cpu time if a process is
running more than 24 hours. In addition, if the process is running
more than 100 days, the coloumn may not be wide enough.

Fix is insterted below. Please include it in future versions!


=== Cut ===
-+- proc.C.orig Tue Feb 23 18:55:54 1999
+++ proc.C Tue Feb 23 19:25:48 1999
@@ -511,8 +511,11 @@
     if(t >= 100 * 60) {
  if(t >= 100 * 3600) {
      int d = t / 86400;
-     t &= 86400;
-     s.sprintf("%dd%dh", d, t / 3600);
+     t /= 3600;
+     if(d >= 100)
+         s.sprintf("%d.%dd", d, ((t - 24*d)*10)/24);
+     else
+         s.sprintf("%dd%2dh", d, t - 24*d);
  } else {
      int h = t / 3600;
      t %= 3600;
=== Cut ===



-- 
Dirk A. Mueller - GoldED support Germany
http://www.rhrk.uni-kl.de/~dmuell/
ICQ 21969129

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic