Skip to content
This repository was archived by the owner on Oct 21, 2020. It is now read-only.

Commit 75f29b7

Browse files
committed
fix(electron): use simple timestamp to calculate download elapsed time
1 parent a44f9e6 commit 75f29b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ember-electron/assets.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ const extractAsset = async (savePath, extractDir, onProgress) => {
9898
const downloadAsset = async (sender, url, onStarted, onProgress) => {
9999
log.info('Downloading asset:', url);
100100

101+
const start = Date.now();
101102
const directory = path.join(app.getPath('downloads'), productName);
102103
await del(directory, { force: true });
103104
await makeDir(directory, { fs });
@@ -113,7 +114,7 @@ const downloadAsset = async (sender, url, onStarted, onProgress) => {
113114
});
114115

115116
const savePath = dl.getSavePath();
116-
const elapsed = Date.now() - dl.getStartTime();
117+
const elapsed = Date.now() - start;
117118
log.info('Asset downloaded:', savePath, `(took ${prettyMs(elapsed)})`);
118119
if (!sender.isDestroyed()) {
119120
sender.send('download-verify');

0 commit comments

Comments
 (0)