Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEditor;
- using System.Collections;
- class CompileTime : EditorWindow {
- bool isTrackingTime;
- double startTime, finishTime, compileTime;
- [MenuItem("Window/Compile Times")]
- public static void Init() {
- EditorWindow.GetWindow(typeof(CompileTime));
- }
- void Update() {
- if (EditorApplication.isCompiling && !isTrackingTime) {
- startTime = EditorApplication.timeSinceStartup;
- isTrackingTime = true;
- }
- else if (!EditorApplication.isCompiling && isTrackingTime) {
- finishTime = EditorApplication.timeSinceStartup;
- isTrackingTime = false;
- compileTime = finishTime - startTime;
- Debug.Log("Script compilation time:" + compileTime.ToString("0.000") + "s");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement