From 865917a222f1e76af53218160d6bedd420deb925 Mon Sep 17 00:00:00 2001 From: Jeffrey Jose Date: Mon, 17 Oct 2016 02:56:24 -0400 Subject: [PATCH 1/2] add engine.swarm.downloadSpeed() --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 0de38a8..e9b077f 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,9 @@ The attached [peer-wire-swarm](https://github.com/mafintosh/peer-wire-swarm) ins #### `engine.swarm.downloaded` Shows the total bytes downloaded. With this you can know how much you downloaded and how many bytes you still have to download to reach the end of the file. +#### `engine.swarm.downloadSpeed()` + +Shows the download speed in bytes/s #### `file = engine.files[...]` From b4778b324cdd4419bddf14700d952534c4c2f838 Mon Sep 17 00:00:00 2001 From: Jeffrey Jose Date: Mon, 17 Oct 2016 02:57:35 -0400 Subject: [PATCH 2/2] You cant accurately know how much more is left to download from engine.swarm.downloaded. This is because you end up downloading more than the totalLength to get the actual file. Possibly because of ignored/invalid chunks. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e9b077f..e9cdf12 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,8 @@ The attached [peer-wire-swarm](https://github.com/mafintosh/peer-wire-swarm) ins #### `engine.swarm.downloaded` -Shows the total bytes downloaded. With this you can know how much you downloaded and how many bytes you still have to download to reach the end of the file. +Shows the total bytes downloaded. With this you can know how much you downloaded. + #### `engine.swarm.downloadSpeed()` Shows the download speed in bytes/s