team-3/src/c3nav/routing/management/commands/testgraph.py

19 lines
497 B
Python
Raw Normal View History

2016-12-05 13:39:22 +01:00
import time
from django.core.management.base import BaseCommand
from c3nav.routing.graph import Graph
class Command(BaseCommand):
help = 'check how long it takes to build the routers for the routing graph'
def handle(self, *args, **options):
start = time.time()
graph = Graph.load()
print('Graph loaded in %.4fs' % (time.time() - start))
start = time.time()
graph.build_router()
print('Routers built in %.4fs' % (time.time() - start))