Added FisheryLib.Collections.FishTable and Mono.Cecil extension methods

A bit of refactoring has been done too
This commit is contained in:
bbradson
2023-06-03 20:10:58 +02:00
parent 8fa92f15a6
commit cdf209eb02
72 changed files with 8145 additions and 2098 deletions
+27
View File
@@ -0,0 +1,27 @@
// Copyright (c) 2022 bradson
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v.2.0.If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
using System.Diagnostics;
using JetBrains.Annotations;
namespace FisheryLib;
[PublicAPI]
public static class StopwatchExtensions
{
public static decimal ElapsedMilliSecondsAccurate(this Stopwatch stopwatch)
=> stopwatch.ElapsedTicks / (_frequency / 1000m);
public static decimal ElapsedSecondsAccurate(this Stopwatch stopwatch)
=> stopwatch.ElapsedTicks / _frequency;
public static decimal ElapsedMicroSeconds(this Stopwatch stopwatch)
=> stopwatch.ElapsedTicks / (_frequency / 1e6m);
public static decimal ElapsedNanoSeconds(this Stopwatch stopwatch)
=> stopwatch.ElapsedTicks / (_frequency / 1e9m);
private static decimal _frequency = Stopwatch.Frequency;
}