class ControllableSocket:

    def __init__(self, latency, bandwidth):
        self._latency = latency
self._bandwidth = bandwidth
self._bytesSent = 0
self._timeCreated = time.time()
self._socket = socket.socket()

def send(self, bytes):
    now = time.time()
Simple way to simulate a slow network in python