C
Chase Preuninger
I have the bps rate that the document is downloading at, the size of
the the document, and how much has been downloaded but I cant seem to
calculate the ETA for it to finish (all I need for now it the time in
seconds.)
for a 9mb file it says 2 seconds left when that is clearly wrong
considering that it takes around 1 minute to finish.
private long getSecondsLeft(long bitRate, long received, long
size)
{
return (bitRate != 0 ? (size - received) / bitRate : -1);
}
the the document, and how much has been downloaded but I cant seem to
calculate the ETA for it to finish (all I need for now it the time in
seconds.)
for a 9mb file it says 2 seconds left when that is clearly wrong
considering that it takes around 1 minute to finish.
private long getSecondsLeft(long bitRate, long received, long
size)
{
return (bitRate != 0 ? (size - received) / bitRate : -1);
}