diff --git a/ProjectLighthouse/Program.cs b/ProjectLighthouse/Program.cs index 11b81681..ae45cb0e 100644 --- a/ProjectLighthouse/Program.cs +++ b/ProjectLighthouse/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Hosting; @@ -7,17 +8,26 @@ using ProjectLighthouse.Types; namespace ProjectLighthouse { public static class Program { public static void Main(string[] args) { + Stopwatch startupStopwatch = new(); + startupStopwatch.Start(); Console.WriteLine("Welcome to Project Lighthouse!"); + Console.WriteLine("Determining if the database is available..."); bool dbConnected = ServerSettings.DbConnected; Console.WriteLine(dbConnected ? "Connected to the database." : "Database unavailable. Exiting."); if(dbConnected) { + Stopwatch migrationStopwatch = new(); + migrationStopwatch.Start(); + Console.WriteLine("Migrating database..."); new Database().Database.Migrate(); - } - else { - Environment.Exit(1); - } + + migrationStopwatch.Stop(); + Console.WriteLine($"Migration took {migrationStopwatch.ElapsedMilliseconds}ms"); + } else Environment.Exit(1); + + startupStopwatch.Stop(); + Console.WriteLine($"Ready! Startup took {startupStopwatch.ElapsedMilliseconds}ms. Passing off control to ASP.NET..."); CreateHostBuilder(args).Build().Run(); }