nomsu/lib/timeout.nom

9 lines
274 B
Plaintext
Raw Normal View History

2017-10-04 19:37:41 -07:00
require "lib/core.nom"
rule [cap at %num instructions] =:
lua code ".."
|print("capped at", \(%num))
2017-10-04 19:40:44 -07:00
|local f = function()
| nomsu:error("Execution quota exceeded. Your code took too long.")
|end
2017-10-04 19:37:41 -07:00
|debug.sethook(f, "", \(%num))