()
| 61 | } |
| 62 | |
| 63 | function getWordsPerMs() { |
| 64 | // filter scroll log to last five minutes |
| 65 | var recent = stats.scrollLog.filter(function(d) { return d.timestamp > (+(new Date()) - 1000*60*5); }); |
| 66 | return recent.length >= 2 ? (recent[recent.length-1].wordCount - recent[0].wordCount) / |
| 67 | (recent[recent.length-1].timestamp - recent[0].timestamp) : 0; |
| 68 | } |
| 69 | |
| 70 | function getEstimatedFinishTime() { |
| 71 | return new Date(+(new Date()) + (stats.wordCount - latest().wordCount) / getWordsPerMs()); |
no outgoing calls
no test coverage detected