From 30605c6c01e45a3fba31f12fb050bded3c2c1d9f Mon Sep 17 00:00:00 2001 From: AriaLyy <511455842@qq.com> Date: Sat, 10 Jun 2017 11:44:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9F=E5=BA=A6=E5=85=AC=E5=8F=B8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/arialyy/aria/core/download/SingleThreadTask.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/SingleThreadTask.java b/Aria/src/main/java/com/arialyy/aria/core/download/SingleThreadTask.java index bb2cb8ea..96a1a276 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/SingleThreadTask.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/SingleThreadTask.java @@ -65,7 +65,11 @@ final class SingleThreadTask implements Runnable { if (-0.9999 < maxSpeed && maxSpeed < 0.00001) { mSleepTime = 0; } else { - mSleepTime = (long) ((mBufSize / 1024) * CONSTANCE.THREAD_NUM / maxSpeed * 1000); + BigDecimal db = new BigDecimal((mBufSize / 1024) / maxSpeed * 1000); + db.setScale(2, BigDecimal.ROUND_UP); + mSleepTime = db.longValue(); + //mSleepTime = (long) ((mBufSize / 1024) * CONSTANCE.THREAD_NUM / maxSpeed * 1000); + //mSleepTime = (long) ((mBufSize / 1024) / maxSpeed * 1000); } }