13 lines
300 B
Lua
Raw Normal View History

2023-01-14 01:57:12 +08:00
-- 记录开始时间
local starttime = os.clock(); --> os.clock()用法
2023-01-14 01:57:12 +08:00
for i = 1, 10, 2 do
print(i)
2023-01-10 14:40:28 +08:00
end
2023-01-14 01:57:12 +08:00
-- 记录结束时间
local endtime = os.clock(); --> os.clock()用法
print(string.format("end time : %.4f", endtime));
print(string.format("cost time : %.4f", endtime - starttime));