/// <summary> /// Gets a <see cref="NetPeerStatisticsSnapshot"/> containing the changes in values in the <see cref="NetPeerStatistics"/> /// since the given <see cref="NetPeerStatisticsSnapshot"/> was made. /// </summary> /// <param name="a">The current <see cref="NetConnectionStatistics"/> containing the up-to-date values.</param> /// <param name="b">The <see cref="NetPeerStatisticsSnapshot"/> containing the base values.</param> /// <returns>A <see cref="NetPeerStatisticsSnapshot"/> containing the changes in values in the <see cref="NetPeerStatistics"/> /// since the given <see cref="NetPeerStatisticsSnapshot"/> was made.</returns> public static NetPeerStatisticsSnapshot Diff(NetPeerStatistics a, NetPeerStatisticsSnapshot b) { var ret = new NetPeerStatisticsSnapshot(a.ReceivedBytes - b.ReceivedBytes, a.ReceivedPackets - b.ReceivedPackets, a.ReceivedMessages - b.ReceivedMessages, a.SentBytes - b.SentBytes, a.SentPackets - b.SentPackets, a.SentMessages - b.SentMessages); return(ret); }
/// <summary> /// Gets a <see cref="NetPeerStatisticsSnapshot"/> containing the changes in values in the <see cref="NetPeerStatistics"/> /// since the given <see cref="NetPeerStatisticsSnapshot"/> was made. /// </summary> /// <param name="a">The current <see cref="NetConnectionStatistics"/> containing the up-to-date values.</param> /// <param name="b">The <see cref="NetPeerStatisticsSnapshot"/> containing the base values.</param> /// <returns>A <see cref="NetPeerStatisticsSnapshot"/> containing the changes in values in the <see cref="NetPeerStatistics"/> /// since the given <see cref="NetPeerStatisticsSnapshot"/> was made.</returns> public static NetPeerStatisticsSnapshot Diff(NetPeerStatistics a, NetPeerStatisticsSnapshot b) { var ret = new NetPeerStatisticsSnapshot(a.ReceivedBytes - b.ReceivedBytes, a.ReceivedPackets - b.ReceivedPackets, a.ReceivedMessages - b.ReceivedMessages, a.SentBytes - b.SentBytes, a.SentPackets - b.SentPackets, a.SentMessages - b.SentMessages); return ret; }