| View previous topic :: View next topic |
| Author |
Message |
Danko Voice
Joined: 09 Mar 2006 Posts: 18
|
Posted: Fri Jun 09, 2006 6:28 am Post subject: How can I check how long it takes to execute a proc? |
|
|
How can I check how long it takes to execute a proc?
aka "Search took x.xxx ms" or something.. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Jun 09, 2006 10:30 pm Post subject: |
|
|
time _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
Danko Voice
Joined: 09 Mar 2006 Posts: 18
|
Posted: Mon Jun 12, 2006 6:56 am Post subject: |
|
|
hm.. could you also give a short example of how to use it in a proc, since I'm quite lost?
| Code: |
proc myproc {nick host hand channel arg} {
set temp [lindex [split $arg] 0]
putquick "privmsg $channel :$temp [time?!]"
}
|
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Jun 12, 2006 8:32 am Post subject: |
|
|
[time] in eggdrop is different than Tcl's [time] command. You can do tests in tclsh, for example:
| Quote: | % proc bla str {
puts $str
}
% time {bla "hey hi!"}
hey hi!
78 microseconds per iteration
% time {bla "hey hi!"} 10
hey hi!
hey hi!
hey hi!
hey hi!
hey hi!
hey hi!
hey hi!
hey hi!
hey hi!
hey hi!
37.8 microseconds per iteration
% |
Edit: It seems that the [time] command works normally on eggdrop1.6.18. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|