PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Printing Heartbeat Frequency

Printing Heartbeat Frequency

Oct 01 2018, 1:27 AM PST

The following example will print the time between each Heartbeat loop 5 times - while the value of count is less than the value of loopCount.

local RunService = game:GetService('RunService')local loopCount = 5
local count = 0

RunService.Heartbeat:Connect(function(step)
    if count < loopCount then
        count = count + 1
        print("Time between each loop: "..step)
    end
end)