Permalink
Browse files

Merge pull request #8 from lwille/master

Fixed ETA calculation
  • Loading branch information...
2 parents 75b88ce + d860bc5 commit fa751ad9bd134ba4b9a4c63f1b3d4a03eaf820d2 TJ Holowaychuk committed Aug 7, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/node-progress.js
@@ -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);

0 comments on commit fa751ad

Please sign in to comment.