Skip to content

Commit

Permalink
Merge pull request #8 from lwille/master
Browse files Browse the repository at this point in the history
Fixed ETA calculation
  • Loading branch information
tj committed Aug 7, 2012
2 parents 75b88ce + d860bc5 commit fa751ad
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/node-progress.js
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,3 @@

/*! /*!
* node-progress * node-progress
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca> * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
Expand Down Expand Up @@ -87,7 +86,7 @@ ProgressBar.prototype.tick = function(len, tokens){
, complete = Math.round(this.width * (this.curr / this.total)) , complete = Math.round(this.width * (this.curr / this.total))
, incomplete = this.width - complete , incomplete = this.width - complete
, elapsed = new Date - this.start , 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); complete = Array(complete).join(this.chars.complete);
incomplete = Array(incomplete).join(this.chars.incomplete); incomplete = Array(incomplete).join(this.chars.incomplete);
Expand Down

0 comments on commit fa751ad

Please sign in to comment.