Пример #1
0
        private void UpdateLags(ClientMetrics clientMetrics, HostMetrics hostMetrics)
        {
            if (hostMetrics != null)
            {
                this.textBuffer.Write("TL ");
                this.textBuffer.WriteDouble(Math.Round(hostMetrics.TickLag, 2), 2);
                this.textBuffer.Write('\n');
            }

            this.textBuffer.Write("UL ");
            this.textBuffer.WriteDouble(Math.Round(clientMetrics.UpdateLag, 2), 2);
            this.textBuffer.Write("\n");
        }
Пример #2
0
        private void UpdateRates(ClientMetrics clientMetrics, HostMetrics hostMetrics)
        {
            if (hostMetrics != null)
            {
                this.textBuffer.Write("TPS ");
                this.textBuffer.WriteInt(hostMetrics.TicksPerSecond);
                this.textBuffer.Write('\n');
            }

            this.textBuffer.Write("UPS ");
            this.textBuffer.WriteInt(clientMetrics.UpdatesPerSecond);
            this.textBuffer.Write('\n');

            this.textBuffer.Write("FPS ");
            this.textBuffer.WriteInt(clientMetrics.FramesPerSecond);
            this.textBuffer.Write("\n\n");
        }
Пример #3
0
        public void Update(GameTime time)
        {
            this.textBuffer.WritePosition = 0;

            HostMetrics   hostMetrics   = null;
            ClientMetrics clientMetrics = this.client.Metrics;

            if (this.host != null && !(this.host is NullHost))
            {
                hostMetrics = this.host.Metrics;
            }

            this.UpdateRates(clientMetrics, hostMetrics);

            this.UpdateLags(clientMetrics, hostMetrics);

            this.UpdateMemoryMetrics();

            this.UpdateMetricCounters();
        }