How to save with time interval

I hope unity auto save my scene per 30 seconds, so I try following code:

using System;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;

[InitializeOnLoad]
public class AutoSave : EditorWindow
{
    static AutoSave()
    {
        Debug.Log($"AutoSave is ii");
        EditorApplication.playmodeStateChanged = () => { Save(); };
    }

    static void Save()
    {
        var sceneName = "ss1";
        EditorSceneManager.SaveScene(EditorSceneManager.GetSceneByName(sceneName));
        Debug.Log("Save Scene " + sceneName);
    }

    private DateTime lastTime = DateTime.Now;

    private void Update()
    {
        if ((DateTime.Now - lastTime).TotalSeconds > 30)
        {
            lastTime = DateTime.Now;
            Save();
        }
    }
}

but Debug.Log("Save Scene " + sceneName) doesn’t show in unity console

using System;
using System.Collections;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;

[InitializeOnLoad]
public class AutoSave : EditorWindow
{
    static AutoSave()
    {
        Debug.Log($"AutoSave is ii");
        EditorApplication.playmodeStateChanged = () => { Save(); };
    }

    static void Save()
    {
        var sceneName = "ss1";
        EditorSceneManager.SaveScene(EditorSceneManager.GetSceneByName(sceneName));
        Debug.Log("Save Scene " + sceneName);
        

    }
    IEnumerator AutoSaveTimer()
    {
        while(true)
        {
            Save();
            yield return new WaitForSecondsRealtime(30); // 30 SECS, CHANGE IF YOU WANT OTHER TIMER
        }
    }
    void Start()
    {
        StartCoroutine("AutoSaveTimer");
    }
    private void Update()
    {
        
    }
}