mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-24 00:36:16 -04:00
Replaced 'new Date().getTime()' calls with 'Date.now()' for clarity and performance
This commit is contained in:
parent
9d09146f68
commit
75da5b650c
5 changed files with 12 additions and 12 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue