1. To do your own benchmark

To optimize your function and procedure, you can try this code.

include my_include.e -- your include if necessary
integer it,moy
atom t0,totalTime
object e totalTime=0

it = 500 moy= 20  --number of iteration and number of reapeat. The total
number of loop is it*moy
for j=1 to moy do
 t0 = time()
 for i=1 to it do
  e= the function to test -- of course remove the 'e=' if your function
is a procedure
end for
 totalTime+=time()-t0
end for

printf(1, "Total     time %9.6f for %d iteration\n",{totalTime,it*moy})
printf(1, "Average   time %9.6f for %d iteration\n",{totalTime/moy,it})
printf(1, "Iteration time %9.6f for 1 iteration\n",totalTime/(moy*it))


Bye bye
        Ryo
--
Ryo
http://www.ryo-sama.com
http://dragonquest.multimania.com

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu