-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using ConsoleApp.Models.Configuration; | ||
using ConsoleApp.Services; | ||
using Microsoft.Extensions.Options; | ||
|
||
namespace ConsoleApp; | ||
|
||
public class BenchmarkService( | ||
IDemoService demoService, | ||
IOptions<ConsoleAppSettings> options) | ||
{ | ||
private readonly IDemoService _demoService = demoService; | ||
private readonly IOptions<ConsoleAppSettings> _options = options; | ||
|
||
[GlobalSetup] | ||
public void Setup() | ||
{ | ||
// initialize things in class if needed | ||
} | ||
|
||
[Benchmark] | ||
public void WriteWelcomeMessage() | ||
{ | ||
for (var i = 0; i < 100; i++) | ||
{ | ||
_demoService.WriteWelcomeMessage(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters