Skip to content

Commit

Permalink
More benchmarks for Duration
Browse files Browse the repository at this point in the history
(As the implementation of these parts might change.)
  • Loading branch information
jskeet committed Jun 9, 2017
1 parent 3452246 commit bbdfcc3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/NodaTime.Benchmarks/NodaTimeTests/DurationBenchmarks.cs
Expand Up @@ -122,6 +122,12 @@ public class DurationBenchmarks
[Benchmark]
public Duration Multiply_SmallBoth() => SmallDuration * 25;

[Benchmark]
public Duration Multiply_SmallByDouble() => SmallDuration * 25.5;

[Benchmark]
public Duration Multiply_LargeByDouble() => LargeDuration * 25.5;

// Here "large" is in the context of the optimizations we make
[Benchmark]
public Duration Multiply_SmallLeftLargeRight() => SmallDuration * 10000;
Expand Down Expand Up @@ -158,5 +164,14 @@ public class DurationBenchmarks

[Benchmark]
public BigInteger ToBigIntegerNanoseconds_Large() => LargeDuration.ToBigIntegerNanoseconds();

[Benchmark]
public double TotalNanoseconds_Small() => SmallDuration.TotalNanoseconds;

[Benchmark]
public double TotalNanoseconds_Medium() => MediumDuration.TotalNanoseconds;

[Benchmark]
public double TotalNanoseconds_Large() => LargeDuration.TotalNanoseconds;
}
}

0 comments on commit bbdfcc3

Please sign in to comment.