- Documentation
- Server functions
- getSyncCost
Function
getSyncCost
Returns how much player synchronisation has cost since the last call: the number of cycles (ticks), the average and longest cycle time in ms (avgMs, maxMs), states per cycle (statesPerTick) and the measured time (seconds). Helps to find server hitches.
Syntax
table getSyncCost()Returns
A table with the fields or false.
Example
setTimer(function()
local c = getSyncCost()
if c then outputServerLog(("sync: %.2f ms śr., %.2f ms max"):format(c.avgMs, c.maxMs)) end
end, 60000, 0)