Skip to content
Permalink
Browse files

fix(electron): use simple timestamp to calculate download elapsed time

  • Loading branch information...
devinus committed Jan 28, 2019
1 parent a44f9e6 commit 75f29b7b48e7d87c4dcb7963e7a6e88cc9154213
Showing with 2 additions and 1 deletion.
  1. +2 −1 ember-electron/assets.js
@@ -98,6 +98,7 @@ const extractAsset = async (savePath, extractDir, onProgress) => {
const downloadAsset = async (sender, url, onStarted, onProgress) => {
log.info('Downloading asset:', url);

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

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

0 comments on commit 75f29b7

Please sign in to comment.
You can’t perform that action at this time.