< Summary

Information
Class: GistBackend.Utils.SelfReportingStopwatch
Assembly: GistBackend
File(s): /home/runner/work/the-gist-of-it-sec/the-gist-of-it-sec/backend/GistBackend/Utils/SelfReportingStopwatch.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 15
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Dispose()100%11100%

File(s)

/home/runner/work/the-gist-of-it-sec/the-gist-of-it-sec/backend/GistBackend/Utils/SelfReportingStopwatch.cs

#LineLine coverage
 1using System.Diagnostics;
 2
 3namespace GistBackend.Utils;
 4
 1205public class SelfReportingStopwatch(Action<double> reportElapsedSeconds) : IDisposable
 6{
 1207    private readonly Stopwatch _stopwatch = Stopwatch.StartNew();
 8
 9    public void Dispose()
 10    {
 12011        GC.SuppressFinalize(this);
 12012        _stopwatch.Stop();
 12013        reportElapsedSeconds(_stopwatch.Elapsed.TotalSeconds);
 12014    }
 15}