Skip to content

Commit

Permalink
Truncate reported time to milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 11, 2024
1 parent f7f84ad commit f3aa2c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ local function check_problem(file_name, expected_answer, is_slow, problem_name)

if not is_slow and elapsed_time > 60 then
error(
"Problem " .. problem_name .. " took " .. tostring(elapsed_time) ..
"Problem " .. problem_name .. " took ~" .. string.format("%.3f", elapsed_time) ..
"s, exceeding the expected time limit of 60s."
)
end

print("Problem " .. problem_name .. " passed (in " .. tostring(elapsed_time) .. "s).")
print("Problem " .. problem_name .. " passed (in ~" .. string.format("%.3f", elapsed_time) .. "s).")
end

-- Problems configuration: filename -> {expected_answer, is_slow}
Expand Down

0 comments on commit f3aa2c0

Please sign in to comment.