Files
RAGECOOP-V/Client/Scripts/Networking/Statistics.cs
Sardelka9515 cac2385c35 Initial migration commit to .NET 7
Menu, sync and other stuff except resource system should be working.
We're far from finished
2023-01-28 20:51:29 +08:00

26 lines
831 B
C#

using System.Threading;
using System.Threading.Tasks;
namespace RageCoop.Client
{
internal static class Statistics
{
static Statistics()
{
ThreadManager.CreateThread(() =>
{
while (!Main.IsUnloading)
{
var bu = Networking.Peer.Statistics.SentBytes;
var bd = Networking.Peer.Statistics.ReceivedBytes;
Thread.Sleep(1000);
BytesUpPerSecond = Networking.Peer.Statistics.SentBytes - bu;
BytesDownPerSecond = Networking.Peer.Statistics.ReceivedBytes - bd;
}
},"Statistics");
}
public static int BytesDownPerSecond { get; private set; }
public static int BytesUpPerSecond { get; private set; }
}
}