local imgui = require("imgui")
local timer = {
bool = false,
start_time = 0,
time = 0
}
function imgui.OnDrawFrame()
imgui.SetNextWindowSize(imgui.ImVec2(200, 100), imgui.Cond.FirstUseEver)
imgui.Begin("stopwatch")
if timer.bool then
timer.time = os.time() - timer.start_time
end
imgui.Text("time " .. timer.time .. " sec")
if imgui.Button("start") then
timer.bool = true
timer.start_time = os.time()
end
imgui.SameLine()
if imgui.Button("stop") then
timer.bool = false
end
imgui.End()
end
imgui.Process = true