Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get process run-time??

Status
Not open for further replies.

RajVerma

Programmer
Jun 11, 2003
62
DE
hi,

is there a specific time function in Tcl that gives the exact process run-time(not the real-time) of running a particular routine? In Lisp we have something like (get-internal-run-time), where we can call this time function before and after the routine so that we can calculate the time difference to get the actual process run-time for that routine.

so I want to know whether there is this kind of possibility in Tcl.

thanx in adv,
Raj.
 
The tcl command time does what you want.
 
hi,

I already checked with this tcl command 'time', but it gives the real time, i.e., the real time taken by the process. but suppose if my system is busy with some other process, say P2(which consumes 50 % of my CPU) then this might affect the actual process, say P1, that I wanted to get the process-run-time for. so in this case, even though the real time might be 10 seconds for this P1, it actually used only 50 % of the CPU resources, so the actual process-run-time should be calculated accordingly to give around 5 sec, I feel. am I right?

I hope u got what I wanted to say.

thnx,
Raj.
 
The start time a process was scheduled to run, iterations in the scheduler, time elapsed in each scheduled segment...etc..
This information may be available, but the granularity you want is probably only available from the kernel scheduler.
getrusage(), the probable *nix side call for the tcl command does not have this information.
OTOH: Windows may be able to give you this info more easily.

In any case I think you have to look outside tcl for
an answer if my problem description is on the mark.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top