Skip to content

Commit dc5a994

Browse files
Merge pull request #148 from simonlindholm/measure-python-time
Don't count time spent in Python towards the player.
2 parents 246ac44 + 9ab3356 commit dc5a994

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

battlecode-manager/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,11 +564,13 @@ def player_handler(self):
564564
my_sandbox.unpause()
565565

566566
start_time = time.perf_counter()
567+
start_time_python = time.process_time()
567568
self.send_message(start_turn_msg)
568569
data = self.get_next_message()
570+
end_time_python = time.process_time()
569571
end_time = time.perf_counter()
570572

571-
diff_time = end_time-start_time
573+
diff_time = (end_time - start_time) - (end_time_python - start_time_python)
572574

573575
my_sandbox.pause()
574576

0 commit comments

Comments
 (0)