Groovy web console

subscribe to the feed Subscribe
to this
site
id0 (via #groovywebconsole)
tweet this snippet Tweet
this
script

id0

Published 7 months ago by me
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
final int id = 0
final int threadNum = 10
final int capacity = 50000

final float percent = (float) (capacity - id) / capacity;
final int index = threadNum - (int) percent * threadNum;
println(index - 1)