mirror of https://github.com/SixLabors/ImageSharp
1 changed files with 19 additions and 0 deletions
@ -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; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue