Is there a way to see how much time my solution takes?

Hi everyone,

When I submit a solution, I sometimes get a timeout on the later test cases even though the first ones pass. But I can’t tell how close I actually am to the limit — a solution that passes might be at 20ms or at 90ms, and I have no way to know.

Is there a way to see the execution time of a solution on CodinGame? Or does everyone just measure it locally with something like time.perf_counter() and hope it matches?

I’m working in Python, so I’d be interested to know if the time limit is adjusted per language or if it’s the same for everyone.

Thanks!

1 Like

You can use time.perf_counter() in the CodinGame IDE, but it should be first called after the inputs have been read, rather than before. Also, when printing the elapsed time, print it to the debug stream by using file=sys.stderr.

Ok, thanks ! :smiley: