Hi All,
I'm working on back end user mode postscript printer driver , I'm
creating an image of word document when user selects "Save as
image" option from windows explorer then I launch a shell while
loading word object and passing it "print" command for getting its
print stream.
The problem I'm having is while deciding the time to pass
WaitForInputIdle function.
DWORD WaitForInputIdle(
HANDLE hProcess,
DWORD dwMilliseconds
I am calculating the time with following formula.

// File Size in bytes
// Process Time in milli seconds

//Constant time can very from CPU to CPU.
If (cpuValue < 450)//P1 And P2 systems
constantTime = 25000
elseif (cpuClock > 450 && cpuClock < 833)//P3 systems
constantTime = 20000
elseif (cpuClock > 833)//P3 pro systems
constantTime = 15000

fileSize = FileLen(fileToPrint)

milliSecond = constantTime + (fileSize / 20)
WaitForInputIdle(handleToProcess , millisecond);
Is there any good way to calculate required running time for an object
where its running time should be flexible for small to large file