Added "how to run..." documentation (#11)

***NO_CI***
This commit is contained in:
Robb Schiefer 2022-10-19 01:00:09 -05:00 коммит произвёл GitHub
Родитель debb705996
Коммит 5d3503b84f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -91,6 +91,34 @@ Console export: CompareObjectTypesBenchmark benchmark class.
| CompareUsingTypeofIfReturn | 10 | 5 ms | 0 ms | 10 ms |
```
## How to run .NET **nanoFramework** Benchmark
Benchmark methods must be run on real hardware. (Note - You may received an OutOfMemory exception if you run many iterations and your hardware doesn't have enough memory.)
1. Create a benchmark project using the "Blank Application (nanoFramework)" template
![image](https://user-images.githubusercontent.com/1071761/196533818-1eb4377d-9f7e-4231-8cb2-20d398388700.png)
2. Update the Program.cs file to the following:
```csharp
public class Program
{
public static void Main()
{
BenchmarkRunner.Run(typeof(IAssemblyHandler).Assembly);
Thread.Sleep(Timeout.Infinite);
}
}
public interface IAssemblyHandler { }
```
3. Add the nanoFramework.Benchmark nuget package to the project
![image](https://user-images.githubusercontent.com/1071761/196534403-cfd3ea10-d8d7-44cb-bfbd-70baf8423d19.png)
5. Lastly attach a nanoFramework device and run the benchmark project
## Attributes
### Class