← All source files

V1 / 8f6c47b125e8

ConsoleSetupTimer.cs

Interfaces/ConsoleApp/LilithConsole/Setup/ConsoleSetupTimer.cs

Changed in this version
CS
using System.Text.Json;
using System.Text.RegularExpressions;
using Lilith.Core.Logging;
using Lilith.Core.Ollama;
using Lilith.Core.Extensions;
using Lilith.Agent;

namespace LilithConsole.Setup;

internal sealed class ConsoleSetupTimer(Logger logger) : IDisposable
{
    private readonly System.Diagnostics.Stopwatch _timer = System.Diagnostics.Stopwatch.StartNew();
    public bool Completed { get; set; }
    public void Dispose()
    {
        _timer.Stop();
        logger.WriteLine("Boot", $"Console setup {(Completed ? "finished" : "stopped")} — elapsed {_timer.Elapsed.TotalSeconds:F2}s", LogColors.Gray);
    }
}