Remove unnecessary rounding

This commit is contained in:
Manav Rathi 2024-05-20 10:15:41 +05:30
parent 78420f65ab
commit 34a8bdcf47
No known key found for this signature in database
4 changed files with 4 additions and 8 deletions

View file

@ -55,9 +55,7 @@ export const execAsync = async (command: string | string[]) => {
: command; : command;
const startTime = Date.now(); const startTime = Date.now();
const result = await execAsync_(escapedCommand); const result = await execAsync_(escapedCommand);
log.debug( log.debug(() => `${escapedCommand} (${Date.now() - startTime} ms)`);
() => `${escapedCommand} (${Math.round(Date.now() - startTime)} ms)`,
);
return result; return result;
}; };

View file

@ -57,8 +57,8 @@ export const indexFaces = async (enteFile: EnteFile, localFile?: File) => {
} }
log.debug(() => { log.debug(() => {
const ms = Math.round(Date.now() - startTime);
const nf = mlFile.faces?.length ?? 0; const nf = mlFile.faces?.length ?? 0;
const ms = Date.now() - startTime;
return `Indexed ${nf} faces in file ${enteFile.id} (${ms} ms)`; return `Indexed ${nf} faces in file ${enteFile.id} (${ms} ms)`;
}); });
return mlFile; return mlFile;

View file

@ -51,9 +51,7 @@ class HEICConverter {
const startTime = Date.now(); const startTime = Date.now();
const convertedHEIC = const convertedHEIC =
await worker.heicToJPEG(fileBlob); await worker.heicToJPEG(fileBlob);
const ms = Math.round( const ms = Date.now() - startTime;
Date.now() - startTime,
);
log.debug(() => `heic => jpeg (${ms} ms)`); log.debug(() => `heic => jpeg (${ms} ms)`);
clearTimeout(timeout); clearTimeout(timeout);
resolve(convertedHEIC); resolve(convertedHEIC);

View file

@ -82,7 +82,7 @@ const ffmpegExec = async (
const result = ffmpeg.FS("readFile", outputPath); const result = ffmpeg.FS("readFile", outputPath);
const ms = Math.round(Date.now() - startTime); const ms = Date.now() - startTime;
log.debug(() => `[wasm] ffmpeg ${cmd.join(" ")} (${ms} ms)`); log.debug(() => `[wasm] ffmpeg ${cmd.join(" ")} (${ms} ms)`);
return result; return result;
} finally { } finally {