import time, urllib, threading, urllib.request
sa = threading.Semaphore(1)
urls = ['http://www.ucc.ie', 'http://www.dkit.ie',
        'http://www.ul.ie', 'http://www.tcd.ie','http://www.ucd.ie']

def getUrlInfo(x):
    newTime = time.time()
    u = urllib.request.urlopen(x)
    sa.acquire()
    print ('It took ',time.time()-newTime,' seconds to get a reply from',x)
    sa.release()

for y in urls:
    t = threading.Thread(target=getUrlInfo, args=(y,))
    t.start()
