• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java class to calculate download rate.  RSS feed

 
Sharmi Gops
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to know is there any class in java to calculate the data download rate.
There is a application Down2Home in net. It calculates the in and out data rate. I want to write a application similar to that.


Thank You
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

Download rate is just the data downloaded per unit time. Pick your data units, pick your time units, and calculate the rate. If you want to get fancy, you can calculate the "instantaneous rate" between each time you call a read(byte[]) method, then display a rolling average of (say) the last five instantaneous rates; or you can display a cumulative average across a whole transaction, whichever makes more sense.

But no, Java has no function that does this, unless you count the "/" operator.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!