using System.Diagnostics;
namespace aoc2020;
public static class Extensions
{
///
/// increased accuracy for stopwatch based on frequency.
///
/// blog
/// details here
///
///
///
///
public static double ScaleMilliseconds(this Stopwatch stopwatch)
{
return 1_000 * stopwatch.ElapsedTicks / (double)Stopwatch.Frequency;
}
public static bool Contains(this Range range, int i)
{
return i >= range.Start.Value && i <= range.End.Value;
}
}