Files
Andrey Ilnitsky 1cdaadbfaa - target net472 and netstandard2.0
- microsoft.extensions.logging 5.0.0
- microsoft.extensions.configuration 5.0.0
2021-07-16 18:04:31 -07:00

25 lines
804 B
C#

// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace DotNetty.Microbench.Codecs
{
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Codecs;
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[BenchmarkCategory("Codecs")]
public class DateFormatterBenchmark
{
const string DateString = "Sun, 27 Nov 2016 19:18:46 GMT";
readonly DateTime date = new DateTime(784111777000L);
[Benchmark]
public DateTime? ParseHttpHeaderDateFormatter() => DateFormatter.ParseHttpDate(DateString);
[Benchmark]
public string FormatHttpHeaderDateFormatter() => DateFormatter.Format(this.date);
}
}