Mad pod racer & async code


I have a problem on my code, when i want execute this:

setTimeout(function() {
my code…;
}, 1200);

I have this response on the console :“the program did not provide 1 input lines in due time…”

I search on differents topic, but i don’t find any answer. Can you help me please?

I just tried with both setTimeout(() => console.log(action),0) and Promise.resolve().then(()=>{console.log(action)}). CG doesn’t seem to support asynchronous code. My assumption is that the whole game is executed synchronously with readline being a kind of while(1) loop that only breaks when the referee makes the inputs available. As such there is no chance for promises nor setTimeout to be executed.

Why would you need to use a setTimeout in the first place? (especially with a timer of 1200ms when the game allows a max of 1000ms to give an output)