Host_Init();
host.realtime = 0;
+ host.sleeptime = 0;
host.dirtytime = Sys_DirtyTime();
while(host.state != host_shutdown)
if (!svs.threaded)
{
+ svs.perf_acc_sleeptime = host.sleeptime;
svs.perf_acc_realtime += time;
// Look for clients who have spawned
{
// 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;
+ 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 = host.sleeptime = 0;
}
else if(svs.perf_acc_realtime > 5)
{
if(svs.perf_lost > 0 && developer_extra.integer)
if(playing) // only complain if anyone is looking
Con_DPrintf("Server can't keep up: %s\n", Host_TimingReport(vabuf, sizeof(vabuf)));
- 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;
+ 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 = host.sleeptime = 0;
}
}
else
Sys_Sleep((int)wait);
delta = Sys_DirtyTime() - time0;
- if (delta < 0 || delta >= 1800) delta = 0;
- if (!svs.threaded)
- svs.perf_acc_sleeptime += delta;
+ if (delta < 0 || delta >= 1800)
+ delta = 0;
+ host.sleeptime += delta;
// R_TimeReport("sleep");
continue;
}
int framecount; // incremented every frame, never reset (checked by Host_Error and Host_SaveConfig_f)
double realtime; // the accumulated mainloop time since application started (with filtering), without any slowmo or clamping
double dirtytime; // the main loop wall time for this frame, equal to Sys_DirtyTime() at the start of this host frame
+ double sleeptime; // time spent sleeping overall
qboolean restless; // don't sleep
qboolean paused; // global paused state, pauses both client and server
} host_t;