logical error with calculating download consumption

37 Views Asked by At

I wrote this code to calculate my internet consumption starting from the time it is started, but it seems to give large number that did not express the real consumption, I could not figure out where I made mistake So why is it doing this, is there any logical error?? enter image description here

1

There are 1 best solutions below

3
Pablo On

If you are printing it in bytes then it will be big won't it? because bytes are a small measurement. if you divide new_total by 1000 then print it, it will be in kilobytes, again and you get megabytes then gigabytes.

I would divide it by 1000000