Replaced 'new Date().getTime()' calls with 'Date.now()' for clarity and performance

This commit is contained in:
n1474335 2020-03-12 15:23:22 +00:00
parent 9d09146f68
commit 75da5b650c
5 changed files with 12 additions and 12 deletions

View file

@ -39,7 +39,7 @@ class Chef {
*/
async bake(input, recipeConfig, options) {
log.debug("Chef baking");
const startTime = new Date().getTime(),
const startTime = Date.now(),
recipe = new Recipe(recipeConfig),
containsFc = recipe.containsFlowControl(),
notUTF8 = options && "treatAsUtf8" in options && !options.treatAsUtf8;
@ -84,7 +84,7 @@ class Chef {
result: await this.dish.get(returnType, notUTF8),
type: Dish.enumLookup(this.dish.type),
progress: progress,
duration: new Date().getTime() - startTime,
duration: Date.now() - startTime,
error: error
};
}
@ -110,7 +110,7 @@ class Chef {
silentBake(recipeConfig) {
log.debug("Running silent bake");
const startTime = new Date().getTime(),
const startTime = Date.now(),
recipe = new Recipe(recipeConfig),
dish = new Dish();
@ -119,7 +119,7 @@ class Chef {
} catch (err) {
// Suppress all errors
}
return new Date().getTime() - startTime;
return Date.now() - startTime;
}