diff --git a/tests/ImageSharp.Benchmarks/General/Modulus.cs b/tests/ImageSharp.Benchmarks/General/Modulus.cs new file mode 100644 index 0000000000..aa3e461e1c --- /dev/null +++ b/tests/ImageSharp.Benchmarks/General/Modulus.cs @@ -0,0 +1,19 @@ +namespace ImageSharp.Benchmarks.General +{ + using BenchmarkDotNet.Attributes; + + public class Modulus + { + [Benchmark(Baseline = true, Description = "Standard Modulus using %")] + public int StandardModulus() + { + return 255 % 256; + } + + [Benchmark(Description = "Bitwise Modulus using &")] + public int BitwiseModulus() + { + return 255 & 255; + } + } +}