Hello,
I was wondering what could I use to track the delay between the client and the server, os.time() doesn’t give me an accurate value as it is always rounded to a sec. I tried using tick(), but even when taking the timezone diff between the client and the serv, it seems like its not accurate too.
Example :
--local script
local timestamp = tick()
local WaitForResp = remote:InvokeServer(timestamp)
local local_time_diff = tick() - timestamp
print(local_time_diff)
-- serverscript
remote.OnServerInvoke = function(plr, timestamp)
timestamp = timestamp - plr.TimeZone.Value --(smthing i created before tracking if its +2, +1,... and * 3600 so its in sec too)
local Serv_time_diff = tick() - timestamp
print("delay :", Serv_time_diff)
end)
I have tried this multiple times on an actual server (not in studio), and sometimes, the local_time_diff is smaller then the Serv_time_diff (which shouldn’t happen and be possible). This proves that I can’t use tick() accuratly for this.
-
on the client
-
on the server
I don’t know how I could get an accurate timing of the delay between the invoke and the oninvoke…
Any ideas ?
Thx for reading