progressstream: add stats func
This commit is contained in:
@@ -14,6 +14,11 @@ class ProgressStream extends TransformStream {
|
||||
this._interval = null;
|
||||
}
|
||||
|
||||
stats() {
|
||||
const totalSecs = Math.round((Date.now() - this._startTime)/1000);
|
||||
return { startTime: this._startTime, totalSecs, transferred: this._transferred };
|
||||
}
|
||||
|
||||
_start() {
|
||||
this._startTime = Date.now();
|
||||
this._started = true;
|
||||
|
||||
Reference in New Issue
Block a user