Re: calculating run time for portions of code



chedderslam wrote:
How would you calculate sections of code run times? For instance in
ColdFusion, there is the function gettickcount(), and you would do
something like this:

set starttime = gettickcount()
(code that you want to time)
set endtime = gettickcount()
set runtime = endtime - starttime

How would I do the same thing in tcl? I would prefer it to be in
milliseconds, if possible.

I am planning on using the ActiveState Tcl Devkit debugger to get the
values of the different time variables, rather than trying to write it
to output. Is there functionality that already does what I'm trying
to accomplish built in?

You can't get the run time, you can get the elapsed time (which may or may not be the same thing depending if there was a context switch during your execution).

Ron already told you how to get the elapsed time.

--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.



Relevant Pages

  • Re: calculating run time for portions of code
    ... ColdFusion, there is the function gettickcount(), and you would do ... set starttime = gettickcount ... set endtime = gettickcount ... How would I do the same thing in tcl? ...
    (comp.lang.tcl)
  • calculating run time for portions of code
    ... ColdFusion, there is the function gettickcount(), and you would do ... set starttime = gettickcount ... set endtime = gettickcount ... I am planning on using the ActiveState Tcl Devkit debugger to get the ...
    (comp.lang.tcl)
  • Re: Thread deadlock misery
    ... The real error is not in the GetTickCount() overflow. ... elapsed time by subtracting it. ... It's NOT safe to just compare it. ... The real error is that dwSleepTime is NEVER negative. ...
    (microsoft.public.vc.language)
  • Re: Environment.TickCount - can I trust the documentation?
    ... > The documentation states that Environment.TickCount is a signed integer ... Environment.TickCount and didn't find code like "GetTickCount() & ... > I want to measure elapsed time in a server application which will, I hope, ... the Environment class to measure elapsed ticks. ...
    (microsoft.public.dotnet.framework)
  • Re: gettickcount returns a negative number???
    ... Platform SDK: Windows System Information - GetTickCount ... "The elapsed time is stored as a DWORD value. ...
    (microsoft.public.vb.winapi)