Is doing flow control like this a good approach and if now then how should i tackle this problem ? https://postimg.cc/d7fqKys3

what i have done till now :

how should i approach it ?

Can you explain what the simulation is supposed to do?

Also what is the purpose of print_queue_time_stamp? I don’t understand why it’s getting randomly generated — I don’t understand the simulation so I am probably missing something.