MCPcopy Create free account
hub / github.com/BloombergGraphics/whatiscode / getWordsPerMs

Function getWordsPerMs

modules/toc/toc.js:63–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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());

Callers 2

getEstimatedFinishTimeFunction · 0.85
renderStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected