quickjs-emscripten
quickjs-emscripten copied to clipboard
shouldInterrupt for the amount of statements
trafficstars
Hi there,
We are currently looking for a library that safely executes code and where we can limit the amount of statements executed. I do see the shouldInterruptAfterDeadline function but there are no others. Is there anything comming for this or should we look into other libraries?
Thanks in advance for responding :)
Documented in quickjs source code, the interrupt handler is called every 10k cycles (which rougly translated to this amount of statements). It's not perfectly granular, but suitable for sandboxing use cases. The example would interrupt after rougly ~10 million statements.