mirror of
https://github.com/Azure/DotNetty.git
synced 2026-10-19 23:29:32 +08:00
1cdaadbfaa
- microsoft.extensions.logging 5.0.0 - microsoft.extensions.configuration 5.0.0
25 lines
804 B
C#
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);
|
|
}
|
|
}
|