[ENH] CPU time for Processes.

Jörn Eyrich Joern.Eyrich at brokat.com
Fri Mar 9 11:19:22 UTC 2001


John M McIntosh wrote:
> 
> First I added new instance vars to Process, startTime, and
> runDuration which track when a process starts based on the
> millisecond clock, and duration which is calculated from the
> startTime and the time the process is stopped when another is
> started. This duration accumulates as an integer.

In general, I think such a feature is very desirable. I see one problem on systems where squeak runs on top of a preemptive multitasking OS, though:
If you have calculated (currentTime - startTime), how do you know how much of that time was actually spent in Squeak and not in other OS processes? You might get equal values, but in one case, the squeak process was really running all the time, but in the other case, squeak may have been preempted and actually only executed a few bytecodes in the same time.
It seems to me one might have to track the time squeak gets from the host OS in between in-squak process switches, too, and factor that in.
OTOH, I think what we are most interested in are not the absolute running times of squeak processes, but their running times in relation to each other within squeak. In the long run, these effects probably average themselves out.

A useful addition to the scheme might be to not only provide support for accumulated cpu time, but also for current load (comparing the running times of each process for the last second or so).





More information about the Squeak-dev mailing list