How to represent burst times in CPU scheduling with a variable

53 Views Asked by At

Instructions:implement Burst-times are assigned at random (10x10^6 cycles - 50x10^12 cycles). How would I convert this to ms the measurement of burst times.

1

There are 1 best solutions below

0
Ext3h On

Theoretically? Pick a clock you know it's accurate, run a simulated burst of 10^6 cycles, and measure how long that took.

Now whenever you get a burst assigned, divide by that originally measured time to get the wall clock duration it's going to take.

Only works if cycle execution time is fixed though. So, by design, it won't work on any non-embedded CPU with dynamic clock states or modern architectures which can't be tricked into busy-waiting at a constant instruction throughput.