mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
437 B
19 lines
437 B
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;
|
|
}
|
|
}
|
|
}
|
|
|