Aug-07-2018, 12:54 PM
Use python tags for multi-line code. The icode tag is for inline code.
You are calculating the time each process would take by itself to fill the data, and then adding them together. That's going to be far longer than it will take all of the processes working together to consume all of the data.
There's a brute force way to do this by looping through seconds, checking each process each second to see if it consume a byte, until all the memory is consumed.
There's a quicker method using the least common multiple of the process times. Then you will know that all of the processes consume x bytes every y seconds. You will still have a little time left over after that, but you can use the brute force method to get the remainder of the time.
There's probably a better solution than than, but it's too early in the morning to get my algorithms book off the shelf.
You are calculating the time each process would take by itself to fill the data, and then adding them together. That's going to be far longer than it will take all of the processes working together to consume all of the data.
There's a brute force way to do this by looping through seconds, checking each process each second to see if it consume a byte, until all the memory is consumed.
There's a quicker method using the least common multiple of the process times. Then you will know that all of the processes consume x bytes every y seconds. You will still have a little time left over after that, but you can use the brute force method to get the remainder of the time.
There's probably a better solution than than, but it's too early in the morning to get my algorithms book off the shelf.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures