]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
don't accumulate time reports for the first 10 seconds of a match so things can settle
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 43ed906b01f2b72b27f142c522a84213e127f469..62530e0833b57e4daa9557abc2b4ea6933305152 100644 (file)
--- a/host.c
+++ b/host.c
@@ -712,7 +712,13 @@ void Host_Main(void)
                                if(host_client->spawned)
                                        if(host_client->netconnection)
                                                playing = true;
-                       if(svs.perf_acc_realtime > 5)
+                       if(sv.time < 10)
+                       {
+                               // don't accumulate time for the first 10 seconds of a match
+                               // so things can settle
+                               svs.perf_acc_realtime = svs.perf_acc_sleeptime = svs.perf_acc_lost = svs.perf_acc_offset = svs.perf_acc_offset_squared = svs.perf_acc_offset_max = svs.perf_acc_offset_samples = 0;
+                       }
+                       else if(svs.perf_acc_realtime > 5)
                        {
                                svs.perf_cpuload = 1 - svs.perf_acc_sleeptime / svs.perf_acc_realtime;
                                svs.perf_lost = svs.perf_acc_lost / svs.perf_acc_realtime;