How long should I wait before getting player ping again?

I don’t need help scripting anything as I know my script works, but I need advice on how often I should ping the player so I can display their ping. I know it can be resource-demanding on the server but my game is single-player.

My code is here, it is from a remote function which returns the players network stats.

while task.wait(1) do
	local result = event:InvokeServer()
	local ping = string.format("%0.0f", result*1000)
	pingLabel.Text=string.format("Client Ping (Round trip in MS): %s", ping)
end

Could I go lower than 1 second without using a lot of valuable server resources or is 1 too much?

I would say you could probably go below 1, but it also depends on the other parts of your game, it might be better to check the Dev Console and see if it takes up too much resources, and also see what is acceptable to the players, maybe you don’t need to go lower (or maybe only by a small number)

1 Like

Where can I see that in the dev console?

during play, press F9 (more info here)