Fri 21 Feb 2014 10:18:20 AM UTC, comment #1:
I'm not sure of what the error is here. The output seems completely legitimate to me.
Also, here is the code snippet that computes the human readable ETA:
if (secs < 100)
sprintf (buf, "%ds", secs);
else if (secs < 100 * 60)
sprintf (buf, "%dm%s%ds", secs / 60, space, secs % 60);
else if (secs < 48 * 3600)
sprintf (buf, "%dh%s%dm", secs / 3600, space, (secs / 60) % 60);
else if (secs < 100 * 86400)
sprintf (buf, "%dd%s%dh", secs / 86400, space, (secs / 3600) % 24);
else
/* even (2^31-1)/86400 doesn't overflow BUF. */
sprintf (buf, "%dd", secs / 86400);
I don't see anything wrong with this math. If you still belive there's something wrong, please let us know
|
Wed 22 Jan 2014 11:38:49 PM UTC, original submission:
Here's a snip from a typical output:
5500K .......... .......... .......... .......... .......... 8% 16.1K 1h40m
5550K .......... .......... .......... .......... .......... 8% 11.9K 1h40m
5600K .......... .......... .......... .......... .......... 8% 12.0K 99m52s
5650K .......... .......... .......... .......... .......... 9% 13.9K 99m30s
5700K .......... .......... .......... .......... .......... 9% 19.9K 98m58s
its clear the time math has not been correctly implemented
the math should be something like
hours = timeremaining div 60 (/)
mins = timeremaining mod 60 (%)
Of course timeremaining could be msecs so some extra bits might be needed
I haven't looked into the code to see whats gone wrong
|