Skip to content

Instantly share code, notes, and snippets.

@deanwampler
Created March 23, 2020 23:50
Show Gist options
  • Save deanwampler/30da944f8d1cc8cf91c2cfa9f11d1405 to your computer and use it in GitHub Desktop.
Save deanwampler/30da944f8d1cc8cf91c2cfa9f11d1405 to your computer and use it in GitHub Desktop.
start1 = time.time()
ids = [(i, rbusy.remote(1.0), time.time() - start1) for i in range(5)]
end1 = time.time() - start1
print('duration1: %6.3f MILLISECONDS' % (1000*end1))
for i,id,t in list(ids):
print('%d: %s (time: %6.3f MILLISECONDS)' % (i, id, 1000*t))
start2 = time.time()
for i,id,t in list(ids):
print('%d: %s (time: %6.3f MILLISECONDS)' % (i, ray.get(id), 1000*(time.time() - start2)))
end2 = time.time() - start2
print('duration2: %6.3f seconds' % end2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment