Skip to content

A simple C# class for comparing performance of different blocks of code

License

Notifications You must be signed in to change notification settings

MattRix/RXPerformanceTester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

RXPerformanceTester

A simple C# class for comparing the relative performance of different blocks of code.

Usage:

RXPerformanceTester.testA = () =>
{
	Math.Sin(0.0);
};

RXPerformanceTester.testB = () =>
{
	Math.Cos(0.0);
};

RXPerformanceTester.Run(25,10000);

You can even do stuff like this:

int[] nums = new int[10000];

RXPerformanceTester.testA = () =>
{
	for(int i = 0; i<nums.Length; i++)
	{
		nums[i] = nums[i];
	}
};

RXPerformanceTester.testB = () =>
{
	int count = nums.Length;
	for(int i = 0; i<count; i++)
	{
		nums[i] = nums[i];
	}
};

RXPerformanceTester.Run(25,100);

Enjoy!

About

A simple C# class for comparing performance of different blocks of code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages