Trying to do a simple time command for procs...can't get output into console...




Hi,

Does anyone have a good generic method of easily timing every proc in
an application for diagnostics? Something that can be turned on and
off at will by simply redefining the proc command? I'm trying from a
freewrapped app, using the following at the beginning of the script,
but I'm failing miserably...

proc TimeProcs {} {
console show
rename ::proc ::proc2
::proc2 ::proc {name vars body} {
::proc2 $name $vars "time {$body}"
}
}

While this doesn't fail, and all the procedures in the script
function, I can't come up with a way to put the time output into the
console.

Inserting a puts command before the time command in the new proc2
procedure gets me into quoting hell. No method seems to work here for
actually getting the output into the console.

Any help would be appreciated!

-Danny

.



Relevant Pages

  • Trying to do a simple time command for procs...cant get output into console...
    ... Does anyone have a good generic method of easily timing every proc in ... off at will by simply redefining the proc command? ... console show ... Inserting a puts command before the time command in the new proc2 ...
    (comp.lang.tcl)
  • Re: Question on tkcon and ls
    ... > Tkcon.tcl contains code for for a proc dir, ... > start tclsh in a console, there is no ls command. ...
    (comp.lang.tcl)
  • Re: Design question/tablelist
    ... moving common functions and GUI options into package code instead of ... The tablelist code chokes in the aquahig::aquatable proc, ... catch {destroy .dirview} ... By the looks of the error, you have an image named after some command ...
    (comp.lang.tcl)
  • Re: function and structures
    ... lines,, i want to implement the same in TcL. ... is to assign to it with a set command (or some other commands such ... probably the best way is to use a Tcl array. ... Functions are declared with the proc command: ...
    (comp.lang.tcl)
  • Re: Confused newbie
    ... Write a proc, test it interactively ... never forget that when you write a loop or a conditional, ... the opening brace of the controlled script should go on the ... intuitive command line editing. ...
    (comp.lang.tcl)