How can I make a stopwatch?

How can I make a stopwatch on a text label?

You could do something like this:

local timing = false
local stop = false

startButton.MouseButton1Click:Connect(function()
    if not timing then
        timing = true
        repeat
            wait(0.01)
            stopwatch.Text = tonumber(stopwatch.Text) + 0.01
        until stop
        stop = false
        timing = false
    end
end)

stopButton.MouseButton1Click:Connect(function()
    stop = true
end)

I haven’t tested this so there might be an error in it