ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getSyncCost

Function

getSyncCost

ServerMiscellaneousTrilogy Hub only

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)

See also