On Tue, Mar 08, 2011 at 06:40:16PM +0200, Rikus Combrinck wrote:
> 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
> 

Yes it does, although in typical Microsoft fashion, the details differ:

http://msdn.microsoft.com/en-us/library/ms683223(v=vs.85).aspx

(I had cause to look into this recently :).

Also my jellyfish model distributed with the EcoLab library is a case
of using times to weight the agents by how much CPU time they
consume. Unfortunately for the OP, this used a distributed memory
message passing model for parallelism, so it worked in this case. I
can't see how to get CPU time reporting at the thread level.

Cheers


-- 

----------------------------------------------------------------------------
Prof Russell Standish                  Phone 0425 253119 (mobile)
Mathematics                              
UNSW SYDNEY 2052                         [email protected]
Australia                                http://www.hpcoders.com.au
----------------------------------------------------------------------------

============================================================
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

Reply via email to