judge0 / ide

✨ Simple, free and open-source online code editor.
https://ide.judge0.com
MIT License
818 stars 257 forks source link

max cpu_time_limit is not excceding 5s #18

Closed coolph007 closed 5 years ago

coolph007 commented 5 years ago

max cpu_time_limit is 5. It should be 15 as per the value of max_cpu_time_limit.

Thanks for all your hard work.

hermanzdosilovic commented 5 years ago

Hi @adityacoder007,

max_cpu_time_limit value that you get (https://api.judge0.com/config_info) is the maximum cpu_time_limit you could set when making a new submission.

Judge0 IDE uses default cpu_time_limit which is 2 as per the data the above link gave us.

aditya999goel commented 5 years ago

Yes, I know that config. But when cpu_time_limit is set to 15 while making your API call, the program still runs for max 5sec.

"cpu_time_limit":"15","cpu_extra_time":"2",

Time Limit Exceeded 5.052s, 252KB

Tried for: for (;;);

hermanzdosilovic commented 5 years ago

That is because wall_time_limit is set to 5 seconds. Set wall_time_limit to 20 (allowed max. is also 20) and let me know if it works.

hermanzdosilovic commented 5 years ago

Take a look here for the explanation about wall_time_limit flag.

aditya999goel commented 5 years ago

yep. Works now. Thanks.