Return to BSD News archive
Newsgroups: comp.unix.bsd Path: sserve!manuel!munnari.oz.au!mips!mips!sdd.hp.com!caen!uunet!newsgate.watson.ibm.com!yktnews!admin!w2chase From: w2chase@watson.ibm.com (Craig Chase) Subject: High Resolution getrusage Message-ID: <1992Aug02.202928.20590@watson.ibm.com> Sender: w2chase@watson.ibm.com (Chase C) Date: Sun, 02 Aug 1992 20:29:28 GMT Disclaimer: This posting represents the poster's views, not necessarily those of IBM Nntp-Posting-Host: tweetie.watson.ibm.com Organization: Electrical Engineering, Cornell University, Ithaca NY Lines: 29 Hello, I would like to get extremely high-resolution process timings for a multi-processor simulator I'm building. The getrusage() function would be ideal for what I want to do, but it appears that it's resolution is somewhere in the several-millisecond range. Unless I can get resolution on the order of a couple of microseconds, I'm SOL on this approach (and I might have to do things the hard way). So, am I S.O.L. on this one? Or is there some way to get better resolution (or some system that supports much higher resolution). Thanks, Craig Chase (No, it is not possible to simply run the simulator several times and divide the aggregate result from the number of runs. This is because I'm simulating interprocess communication and have to simulate a single, coherent virtual clock from the individual process times. To do this, I have to have an accurate reading of the user mode CPU time consumed by a process whenever it "sends" a message. Since a process may send a message every 100 microseconds or less, I need resolution better than 10 microseconds to even have a prayer of accurately simulating the time a multiprocessor would take).