How can I get server speed in hertz?

So I am trying to make a debug UI for moderators in my game to diagnose server issues, the reason why I cannot use the console for example is because they do not have studio access to the game so they cannot use the console to its full extent.

For the most part, it is working, but I am trying to figure out a way to get server speed measured in hz (hertz), is there a simple way to do this?

What do you mean by server speed? If you are talking about heartbeat frame times, then frequency = 1/time delta

heartbeat:Connect(function(timedelta)
    local frequency = 1/timedelta
end)
1 Like

When I say server speed, I sort of mean how fast the server executes actions, sort of like ping but just on the server, not client to server.

local timeStart = os.clock()
-- do stuff
local timeFinal = os.clock()-timeStart
3 Likes

Ok thanks a lot, is there any particular code I could run to find an accurate time?

tick() returns the amount of time that has passed since January 1st, 1970 in seconds, with decimals being milliseconds. It does lose some precision due to float errors, but it is good if you just want a millisecond time stamp.

os.time() returns the same, but without milliseconds.

1 Like

Is there any code in specific I could run in that would give an accurate enough time?

Don’t know exactly what you mean.

os.clock() returns the amount of time in seconds and milliseconds since Lua started.
time() returns the amount of time in seconds since the game started.

tick() returns the amount of time in seconds and milliseconds since the UNIX epoch.

os.date() is used to get formatted time.

Those are the functions you can use to get the time at the very moment the function is called.

1 Like

Oh sorry for the confusion, I think I’ve figured it out now, thanks for your help :slightly_smiling_face: