2
0
mirror of https://github.com/gchq/CyberChef synced 2026-01-08 19:43:18 +00:00

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

@@ -37,7 +37,7 @@ class WindowWaiter {
* focus is returned.
*/
windowBlur() {
this.windowBlurTime = new Date().getTime();
this.windowBlurTime = Date.now();
}
@@ -52,7 +52,7 @@ class WindowWaiter {
* a long time and the browser has swapped out all its memory.
*/
windowFocus() {
const unfocusedTime = new Date().getTime() - this.windowBlurTime;
const unfocusedTime = Date.now() - this.windowBlurTime;
if (unfocusedTime > 60000) {
this.app.silentBake();
}

View File

@@ -375,7 +375,7 @@ class WorkerWaiter {
*/
bakingComplete() {
this.setBakingStatus(false);
let duration = new Date().getTime() - this.bakeStartTime;
let duration = Date.now() - this.bakeStartTime;
duration = duration.toLocaleString() + "ms";
const progress = this.getBakeProgress();
@@ -489,7 +489,7 @@ class WorkerWaiter {
bake(recipeConfig, options, progress, step) {
this.setBakingStatus(true);
this.manager.recipe.updateBreakpointIndicator(false);
this.bakeStartTime = new Date().getTime();
this.bakeStartTime = Date.now();
this.bakeId++;
this.recipeConfig = recipeConfig;
this.options = options;