Performance optimizations

This commit is contained in:
Christian Kratky
2017-11-25 23:10:48 +01:00
parent 24ab285066
commit 611fabcd01
11 changed files with 105 additions and 88 deletions
@@ -171,16 +171,16 @@ namespace MQTTnet.TestApp.NetCore
var msgs = 0;
var stopwatch = Stopwatch.StartNew();
mqttServer.ApplicationMessageReceived += (sender, args) =>
{
msgs++;
if (stopwatch.ElapsedMilliseconds > 1000)
{
Console.WriteLine($"received {msgs}");
msgs = 0;
stopwatch.Restart();
}
};
////mqttServer.ApplicationMessageReceived += (sender, args) =>
////{
//// msgs++;
//// if (stopwatch.ElapsedMilliseconds > 1000)
//// {
//// Console.WriteLine($"received {msgs}");
//// msgs = 0;
//// stopwatch.Restart();
//// }
////};
await mqttServer.StartAsync(new MqttServerOptions());
Console.WriteLine("Press any key to exit.");