aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Program.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2022-12-14 22:03:26 +0100
committerGitHub <noreply@github.com>2022-12-14 22:03:26 +0100
commita455e580be2e650fafb8e768c4978d9ff83ca3c4 (patch)
tree0b345b7bdfaaa7851c6ea51c29a312ef639a6b4a /Jellyfin.Server/Program.cs
parent3462676a8f288358d65484ce2022b66ef9da5ee9 (diff)
Use static methods StopWatch where it makes sense (#8898)
Diffstat (limited to 'Jellyfin.Server/Program.cs')
-rw-r--r--Jellyfin.Server/Program.cs7
1 files changed, 2 insertions, 5 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 46f45b9ad..7052f4d2b 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -94,8 +94,7 @@ namespace Jellyfin.Server
private static async Task StartApp(StartupOptions options)
{
- var stopWatch = new Stopwatch();
- stopWatch.Start();
+ var startTimestamp = Stopwatch.GetTimestamp();
// Log all uncaught exceptions to std error
static void UnhandledExceptionToConsole(object sender, UnhandledExceptionEventArgs e) =>
@@ -217,9 +216,7 @@ namespace Jellyfin.Server
await appHost.RunStartupTasksAsync(_tokenSource.Token).ConfigureAwait(false);
- stopWatch.Stop();
-
- _logger.LogInformation("Startup complete {Time:g}", stopWatch.Elapsed);
+ _logger.LogInformation("Startup complete {Time:g}", Stopwatch.GetElapsedTime(startTimestamp));
// Block main thread until shutdown
await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false);