Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. generator:
  2. def threadCreate(i):
  3.     id=0
  4.     startTime = random.randint(i, i+20)
  5.     while (id==0 or id in ids):
  6.         id = random.randint(1, 20)
  7.     working = random.randint(1,10)
  8.     priority=  random.randint(1,10)
  9.     rasp = random.randint(0,1)
  10.     thread =[startTime, id, working, priority, rasp]
  11.     threads.append(thread)
  12.  
  13.  
  14. main:
  15. while (True):
  16.     if(curTime==random.randint(curTime, curTime+25)):
  17.         threadCreate(curTime)
  18.         maxThread+=1
  19.     multyCriteriaOutput(curTime)
  20.     curTime+=1
  21.     time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement