diff --git a/com.code-philosophy.obfuz/Editor/Obfuscator.cs b/com.code-philosophy.obfuz/Editor/Obfuscator.cs index ecb1a55..c19ed3a 100644 --- a/com.code-philosophy.obfuz/Editor/Obfuscator.cs +++ b/com.code-philosophy.obfuz/Editor/Obfuscator.cs @@ -90,14 +90,17 @@ namespace Obfuz public void Run() { - Debug.Log($"Obfuscator Run. begin"); + Debug.Log($"Obfuscator begin"); + var sw = new System.Diagnostics.Stopwatch(); + sw.Start(); FileUtil.RecreateDir(_coreSettings.obfuscatedAssemblyOutputPath); FileUtil.RecreateDir(_coreSettings.obfuscatedAssemblyTempOutputPath); RunPipeline(_pipeline1); _assemblyResolver.InsertFirst(new PathAssemblyResolver(_coreSettings.obfuscatedAssemblyTempOutputPath)); RunPipeline(_pipeline2); FileUtil.CopyDir(_coreSettings.obfuscatedAssemblyTempOutputPath, _coreSettings.obfuscatedAssemblyOutputPath, true); - Debug.Log($"Obfuscator Run. end"); + sw.Stop(); + Debug.Log($"Obfuscator end. cost time: {sw.ElapsedMilliseconds} ms"); } private void RunPipeline(Pipeline pipeline) diff --git a/com.code-philosophy.obfuz/Editor/Pipeline.cs b/com.code-philosophy.obfuz/Editor/Pipeline.cs index 9e92d46..249ce8e 100644 --- a/com.code-philosophy.obfuz/Editor/Pipeline.cs +++ b/com.code-philosophy.obfuz/Editor/Pipeline.cs @@ -1,5 +1,6 @@ using Obfuz.ObfusPasses; using System.Collections.Generic; +using System.Diagnostics; namespace Obfuz { @@ -34,9 +35,13 @@ namespace Obfuz public void Run() { + var sw = new Stopwatch(); foreach (var pass in _passes) { + sw.Restart(); pass.Process(); + sw.Stop(); + UnityEngine.Debug.Log($"Pass: {pass.GetType().Name} process cost time: {sw.ElapsedMilliseconds}ms"); } } }