shawenguan il y a 1 an
Parent
commit
8331c38146
3 fichiers modifiés avec 19 ajouts et 5 suppressions
  1. 3 2
      Scripts/dingdong/dingdongHelper.js
  2. 16 3
      Scripts/util/MagicJS3.js
  3. 0 0
      Scripts/util/MagicJS3.min.js

Fichier diff supprimé car celui-ci est trop grand
+ 3 - 2
Scripts/dingdong/dingdongHelper.js


+ 16 - 3
Scripts/util/MagicJS3.js

@@ -154,6 +154,7 @@ function MagicJS(scriptName = "MagicJS", logLevel = "INFO") {
                     this.notification.setBark(barkUrl);
                 }
             }
+            this.logger.log(`${scriptName}, 开始执行!`);
         }
         get isRequest() {
             return typeof $request !== "undefined" && typeof $response === "undefined";
@@ -176,10 +177,22 @@ function MagicJS(scriptName = "MagicJS", logLevel = "INFO") {
                 return undefined;
             }
         }
+
+        costTime() {
+            let info = `${this.scriptName}执行完毕!`
+            // if (this.isNode && this.isExecComm) {
+            //     info = `指令【${this.comm[1]}】执行完毕!`
+            // }
+            this._endTime = new Date().getTime();
+            const ms = this._endTime - this._startTime;
+            const costTime = ms / 1000;
+            this.log(`${info}耗时【${costTime}】秒`);
+        }
         done = (value = {}) => {
-            this._endTime = Date.now();
-            let span = (this._endTime - this._startTime) / 1e3;
-            this.logger.info(`SCRIPT COMPLETED: ${span} S.`);
+            // this._endTime = Date.now();
+            // let span = (this._endTime - this._startTime) / 1e3;
+            // this.logger.info(`SCRIPT COMPLETED: ${span} S.`);
+            this.costTime();
             if (typeof $done !== "undefined") {
                 $done(value);
             }

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
Scripts/util/MagicJS3.min.js


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff