Rework diff numbers

This commit is contained in:
Mark Nellemann 2022-11-11 15:14:26 +01:00
parent 07de3cb84e
commit d726bc1982
1 changed files with 7 additions and 9 deletions

16
main.c
View File

@ -90,19 +90,19 @@ int main(int argc, char* argv[]) {
}
unsigned long drbytes = 0;
if(history[i][1] > 0) {
drbytes = rbytes - history[i][1];
if(history[i][0] > 0) {
drbytes = rbytes - (history[i][0] * bsize);
}
unsigned long dwblbks = 0;
if (history[i][2] > 0) {
dwblbks = wblks - history[i][2];
if (history[i][1] > 0) {
dwblbks = wblks - history[i][1];
}
unsigned long dwbytes = 0;
if(history[i][3] > 0) {
dwbytes = wbytes - history[i][3];
if(history[i][1] > 0) {
dwbytes = wbytes - (history[i][1] * bsize);
}
@ -119,9 +119,7 @@ int main(int argc, char* argv[]) {
dwbytes);
history[i][0] = rblks;
history[i][1] = rbytes;
history[i][2] = wblks;
history[i][3] = wbytes;
history[i][1] = wblks;
}
sleep(10);