Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed ETA algorithm according to #4

  • Loading branch information...
commit d860bc5d455c185cd788ed177ec30811f0c1ccf9 1 parent a10eaee
Leonhardt Wille lwille authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  lib/node-progress.js
3  lib/node-progress.js
View
@@ -1,4 +1,3 @@
-
/*!
* node-progress
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
@@ -87,7 +86,7 @@ ProgressBar.prototype.tick = function(len, tokens){
, complete = Math.round(this.width * (this.curr / this.total))
, incomplete = this.width - complete
, elapsed = new Date - this.start
- , eta = elapsed * (1 - (this.curr / this.total));
+ , eta = elapsed * (this.total / this.curr - 1)
complete = Array(complete).join(this.chars.complete);
incomplete = Array(incomplete).join(this.chars.incomplete);
Please sign in to comment.
Something went wrong with that request. Please try again.