This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ShortestPath { | |
// Setup | |
constructor(coordinates) { | |
this.dissectors = coordinates; | |
this.totalDissectors = coordinates.length; | |
this.popSize = 500; | |
this.population = []; | |
this.fitness = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
import concurrent.futures | |
# Start my timer | |
begin = time.perf_counter() | |
quote_urls = [ | |
"https://www.tronalddump.io/quote/L21PXLngRJKWZMbYxe9H7w", | |
"https://www.tronalddump.io/quote/U6NdL3xJRECVsvp5x-Uslw", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
# Start my timer | |
begin = time.perf_counter() | |
# This is the function that we are starting in a new thread each time | |
def get_quote(url): | |
res = requests.get(url) # Api call (the step that causes downtime) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
import concurrent.futures | |
# Start my timer | |
begin = time.perf_counter() | |
# This is the function that we are starting in a new thread each time | |
def get_quote(url): |