Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Program.cs 1.9 KiB

6 år sedan
6 år sedan
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using BenchmarkDotNet.Running;
  3. using MQTTnet.Diagnostics;
  4. namespace MQTTnet.Benchmarks
  5. {
  6. public static class Program
  7. {
  8. public static void Main(string[] args)
  9. {
  10. Console.WriteLine($"MQTTnet - BenchmarkApp.{TargetFrameworkInfoProvider.TargetFramework}");
  11. Console.WriteLine("1 = MessageProcessingBenchmark");
  12. Console.WriteLine("2 = SerializerBenchmark");
  13. Console.WriteLine("3 = LoggerBenchmark");
  14. Console.WriteLine("4 = TopicFilterComparerBenchmark");
  15. Console.WriteLine("5 = ChannelAdapterBenchmark");
  16. Console.WriteLine("6 = MqttTcpChannelBenchmark");
  17. Console.WriteLine("7 = TcpPipesBenchmark");
  18. Console.WriteLine("8 = MessageProcessingMqttConnectionContextBenchmark");
  19. var pressedKey = Console.ReadKey(true);
  20. switch (pressedKey.KeyChar)
  21. {
  22. case '1':
  23. BenchmarkRunner.Run<MessageProcessingBenchmark>();
  24. break;
  25. case '2':
  26. BenchmarkRunner.Run<SerializerBenchmark>();
  27. break;
  28. case '3':
  29. BenchmarkRunner.Run<LoggerBenchmark>();
  30. break;
  31. case '4':
  32. BenchmarkRunner.Run<TopicFilterComparerBenchmark>();
  33. break;
  34. case '5':
  35. BenchmarkRunner.Run<ChannelAdapterBenchmark>();
  36. break;
  37. case '6':
  38. BenchmarkRunner.Run<MqttTcpChannelBenchmark>();
  39. break;
  40. case '7':
  41. BenchmarkRunner.Run<TcpPipesBenchmark>();
  42. break;
  43. case '8':
  44. BenchmarkRunner.Run<MessageProcessingMqttConnectionContextBenchmark>(new AllowNonOptimized());
  45. break;
  46. }
  47. Console.ReadLine();
  48. }
  49. }
  50. }