The Linux C library (probably most *nixes) has a time() function that can return, amongst others, the actual time that the CPU dedicated to the calling process, as opposed to simple elapsed time. Unfortunately, I don't think it can be made to report on thread level, which is probably what you'd like. For what it's worth: http://linux.die.net/man/2/times
There is an associated shell command that can report the same information: http://linux.die.net/man/1/time Related: http://linux.die.net/man/2/getrusage I'm almost certain the Win32 API does not support anything similar. Rikus On Mon, Mar 7, 2011 at 19:38, Russ Abbott <[email protected]> wrote: I'm considering the development of an ABM in which the agents are charged > for the computations they do. But I can't think of a language that > facilitates that. I know that in most languages one can look at the > real-time clock, but I can't think of a language in which one can look at a > dynamic count of (virtual) instructions executed -- or even an dynamic > measure of the amount of CPU time devoted to executing the instructions of > each agent. Am I missing something obvious? Can anyone help. > > Thanks. > > *-- Russ* >
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org
