From 8bad7e46905c2d028d5501d8eaf33f38b1db7cb1 Mon Sep 17 00:00:00 2001 From: Richard Bronkhorst Date: Mon, 12 Jun 2023 14:41:27 +0200 Subject: [PATCH] Update commander.py --- nullptr/commander.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nullptr/commander.py b/nullptr/commander.py index 946f08e..b7ba38e 100644 --- a/nullptr/commander.py +++ b/nullptr/commander.py @@ -5,9 +5,10 @@ from nullptr.models.agent import Agent from nullptr.models.system import System from nullptr.models.waypoint import Waypoint from nullptr.models.marketplace import Marketplace +from nullptr.models.jumpgate import Jumpgate from nullptr.api import Api from .util import * -from time import sleep +from time import sleep, time from threading import Thread from nullptr.atlas_builder import AtlasBuilder @@ -64,6 +65,15 @@ class Commander(CommandLine): pprint(r) def do_test(self): + start_time = time() + total = 0 for m in self.store.all('', Marketplace, True): - print(m) - + total += 1 + dur = time() - start_time + print(f'{total} markets in {dur:.2f} seconds') + start_time = time() + total = 0 + for m in self.store.all('', Jumpgate, True): + total += 1 + dur = time() - start_time + print(f'{total} jumpgates in {dur:.2f} seconds')