phil750 19 Junior Poster in Training

I have an array full of ints,

the program prints out a line depends on the numbr of int
e.g. if int is 8 it will print the line 8 times.

And do this for all the ints stored in the array.

this is my output:

Start of processing --->
Process id 1 -> Quantum No: 0 Quantum left: 2 -> Quantum Total:2 -> Priority:0
Process id 1 -> Quantum No: 1 Quantum left: 1 -> Quantum Total:2 -> Priority:0
Process id 1 -> Quantum No: 2 Quantum left: 0 -> Quantum Total:2 -> Priority:0

Process id 3 -> Quantum No: 0 Quantum left: 3 -> Quantum Total:3 -> Priority:0
Process id 3 -> Quantum No: 1 Quantum left: 2 -> Quantum Total:3 -> Priority:0
Process id 3 -> Quantum No: 2 Quantum left: 1 -> Quantum Total:3 -> Priority:0
Process id 3 -> Quantum No: 3 Quantum left: 0 -> Quantum Total:3 -> Priority:0

Process id 2 -> Quantum No: 0 Quantum left: 3 -> Quantum Total:3 -> Priority:1
Process id 2 -> Quantum No: 1 Quantum left: 2 -> Quantum Total:3 -> Priority:1
Process id 2 -> Quantum No: 2 Quantum left: 1 -> Quantum Total:3 -> Priority:1
Process id 2 -> Quantum No: 3 Quantum left: 0 -> Quantum Total:3 -> Priority:1

Process id 4 -> Quantum No: 0 Quantum left: 1 -> Quantum Total:1 -> Priority:2
Process id 4 -> Quantum No: 1 Quantum left: 0 -> Quantum Total:1 -> Priority:2


, i want to work out the wait time and the turn around time, but im abit clueless on how to do it.
I now what they are and how to work them out
e.g. wait time is the time each program has to wait to start.

I was thinking maybe putting a overall counter on them to count all the processes
but then i wouldnt now how to work out it from there

any advice?


edit -- turn around time done, just did total time / number time went round loop +1

just struggling with wait time

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.