This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Required nuget packages: | |
// - NLog | |
// - BenchmarkDotNet | |
namespace BenchmarkNlogTimeSources | |
{ | |
public class TimeSourceBenchmark | |
{ | |
private readonly TimeSource _fastLocalTimeSource = new FastLocalTimeSource(); | |
private readonly TimeSource _fastUtcTimeSource = new FastUtcTimeSource(); | |
private readonly TimeSource _accurateLocalTimeSource = new AccurateLocalTimeSource(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void EquivalentCollection() | |
{ | |
var c1 = new[] { 1, 2, 3 }; | |
var c2 = new[] { 1, 2, 3 }; | |
Assert.That(c1, Is.EquivalentTo(c2).Using<int, int>((first, second) => | |
{ | |
Assert.That(first, Is.EqualTo(second)); | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BackgroundServiceOnObservableSchedule : BackgroundService | |
{ | |
private static readonly ILogger Logger = Log.ForContext<BackgroundServiceOnObservableSchedule>(); | |
private readonly IObservable<Unit> workerSequence; | |
private IDisposable workerSubscription; | |
public BackgroundServiceOnObservableSchedule() | |
{ | |
workerSequence = Observable |
OlderNewer