Hi, I’ve been here awhile. I’ve searched the forum for answers to these questions but not found anything that really answers them.
I have a couple questions about how timeout is calculated and what I can do to monitor the time spent in my program. I’m currently coding in c# and using StopWatch. I determined that the Codingame is using the high resolution timer which is great, but in the puzzle I’m currently working on (CodeRoyale) the time per-turn is 50 milliseconds, and I’m timing my code and it exceeds 50 milliseconds regularly, but I’m not getting a timeout. This is before I’m even doing any significant code logic, and all I’m doing is parsing the input, I’m not calculating any derived values from the input. I suspect that Console.Readline is taking most of the time since IO is very slow.
Which leads me to my first question: Does IO time count? Could I possibly get a more accurate time measurement in my code if I stop the stopwatch before Console.Readline and restart it afterwards? Because according to my calculations, I should be timing out already before I’ve even really started coding my solution to the problem, so that’s discouraging me from going any further.
And the other question is, are there docs anywhere that explain how CG calculates time spent in my code? Or can any members chime in with their experience and opinion about this?