Changeset 698 for AE/installer2/src/net/oni2/aeinstaller/backend/packages/download/ModDownloader.java
- Timestamp:
- Mar 13, 2013, 8:00:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/backend/packages/download/ModDownloader.java
r648 r698 82 82 83 83 private int getTimeElapsed() { 84 int total = (int) (new Date().getTime() - startMS) / 1000;84 int total = (int) (new Date().getTime() - startMS); 85 85 return total; 86 86 } … … 88 88 private int getDownloadSpeed() { 89 89 int elap = getTimeElapsed(); 90 intdown = downloadedComplete + downloadedCurrent;90 long down = downloadedComplete + downloadedCurrent; 91 91 if (elap > 0) 92 return down / elap;92 return (int)(down * 1000 / elap); 93 93 else 94 94 return 1; … … 106 106 downloads.get(currentDownload).getMod(), state, unpacked, 107 107 downloads.size(), downloadedComplete + downloadedCurrent, 108 totalSize, getTimeElapsed() , getTimeRemaining(),108 totalSize, getTimeElapsed() / 1000, getTimeRemaining(), 109 109 getDownloadSpeed()); 110 110 } else { 111 111 listener.updateStatus(this, null, state, unpacked, 112 112 downloads.size(), downloadedComplete + downloadedCurrent, 113 totalSize, getTimeElapsed() , getTimeRemaining(),113 totalSize, getTimeElapsed() / 1000, getTimeRemaining(), 114 114 getDownloadSpeed()); 115 115 }
Note:
See TracChangeset
for help on using the changeset viewer.