Update commander.py
This commit is contained in:
		
							parent
							
								
									db312d2e35
								
							
						
					
					
						commit
						8bad7e4690
					
				@ -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')
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user