Permalink
Browse files

Add benchmark for LocalDateTime.ToLocalInstant

This has to return a wrapper as LocalInstant is internal.
  • Loading branch information...
jskeet committed Aug 18, 2017
1 parent 509ed22 commit 29ed52a645d2999d6af0b555ff7e69caf318d914
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/NodaTime.Benchmarks/NodaTimeTests/LocalDateTimeBenchmarks.cs
@@ -147,11 +147,14 @@ public class LocalDateTimeBenchmarks
public LocalDateTime MinusMixedPeriod() => (Sample - SampleMixedPeriod);
#if !NO_INTERNALS
// [Benchmark]
// public LocalInstant ToLocalInstant()
// {
// return Sample.ToLocalInstant();
// }
[Benchmark]
public LocalInstantWrapper ToLocalInstant() => new LocalInstantWrapper(Sample.ToLocalInstant());
public struct LocalInstantWrapper
{
private readonly LocalInstant value;
internal LocalInstantWrapper(LocalInstant value) => this.value = value;
}
#endif
}
}

0 comments on commit 29ed52a

Please sign in to comment.