fix(core): Fixes date time uses by using stop watch (#549)

- [X] Replaces measurements with stop watch
- [X] Some cleanup
This commit is contained in:
Kamron Batman 2021-03-13 12:39:30 -08:00 committed by GitHub
parent 6c4308bce6
commit 76970325a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 13 deletions

View file

@ -97,15 +97,15 @@ namespace Server
if (_profileStart > 0)
{
_profileTime += TickCount - _profileStart;
_profileTime += Stopwatch.GetTimestamp() - _profileStart;
}
_profileStart = _profiling ? TickCount : 0;
_profileStart = _profiling ? Stopwatch.GetTimestamp() : 0;
}
}
public static TimeSpan ProfileTime =>
TimeSpan.FromMilliseconds(_profileStart > 0 ? _profileTime + (TickCount - _profileStart) : _profileTime);
TimeSpan.FromTicks(_profileStart > 0 ? _profileTime + (Stopwatch.GetTimestamp() - _profileStart) : _profileTime);
public static Assembly Assembly { get; set; }