progressstream: add stats func

This commit is contained in:
Girish Ramakrishnan
2024-05-31 16:55:37 +02:00
parent 0227ae1d96
commit 449d68122b

View File

@@ -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;