| View previous topic :: View next topic |
| Author |
Message |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Wed Mar 10, 2021 2:11 pm Post subject: Best way to test Proc speed |
|
|
So is this a good/best way to test the proc speed?
| Code: |
bind PUB - "!test" speed:test
proc speed:test {nick host hand chan text} {
set start [clock clicks]
putquick "MODE $chan +o $nick"
set end [clock clicks]
puthelp "PRIVMSG $chan : Timespan: [expr ($end-$start)/1000.0]ms"
}
|
(Found this code from http://forum.egghelp.org/viewtopic.php?t=20784 | thanks to caesar) _________________ ComputerTech |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Wed Mar 10, 2021 5:03 pm Post subject: |
|
|
thanks willyw, appreciate it  _________________ ComputerTech |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Fri Mar 12, 2021 3:21 pm Post subject: |
|
|
Just thought i'd post my finished working proc speed test code
| Code: |
bind PUB - "!speed" do:test
proc proc:name {nick host hand chan text} {
putserv "PRIVMSG $chan :foo"
}
proc do:test {nick host hand chan text} {
set foo [ time {proc:name $nick $host $hand $chan $text} 1]
set aoo [lindex [split $foo] 0]
set qoo "[expr {$aoo / 1000.00}]ms"
puthelp "PRIVMSG $chan :Proc Name : $tproc"
puthelp "PRIVMSG $chan :Proc Speed: $qoo"
}
|
_________________ ComputerTech |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Mar 13, 2021 7:10 am Post subject: |
|
|
The clock clicks should yield the same results. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Sat May 08, 2021 1:50 am Post subject: |
|
|
Just curious why the "time" command yields different milliseconds each time
| Code: |
125 microseconds per iteration
% time {puts "hello"} 1
hello
121 microseconds per iteration
% time {puts "hello"} 1
hello
126 microseconds per iteration
% time {puts "hello"} 1
hello
126 microseconds per iteration
% time {puts "hello"} 1
hello
126 microseconds per iteration
% time {puts "hello"} 1
hello
123 microseconds per iteration
% time {puts "hello"} 1
hello
92 microseconds per iteration
%
|
^^ on tclsh  _________________ ComputerTech |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Sat May 08, 2021 4:15 am Post subject: |
|
|
Just because the cpu could be used for other / different things and not 100% of the cpu (nor the same percentage) is dedicated to tclsh. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Sat May 08, 2021 4:07 pm Post subject: |
|
|
Okay, so what would be an alternative way to test proc speed and not rely on CPU ? would need exact 0.00seconds to compare different procs
thanks in advanced _________________ ComputerTech |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Mon May 10, 2021 12:27 pm Post subject: |
|
|
Thanks CrazyCat  _________________ ComputerTech |
|
| Back to top |
|
 |
|