from java.util import Random
from jhplot import *
import time
a=P0D("high-performance")
b=ArrayList()
c=[]
r=Random()
Ntot=3000000 # number of events for testing
start = time.clock()
for i in range(Ntot):
x=r.nextGaussian()
a.add(x)
print ' CPU time for P0D (s) in Jython Loop=',time.clock()-start
start = time.clock()
a.randomNormal(Ntot, 0, 1)
print ' CPU time for P0D (s) native method =',time.clock()-start
start = time.clock()
for i in range(Ntot):
x=r.nextGaussian()
c.append(x)
print ' CPU time for Jython list (s)=',time.clock()-start
start = time.clock()
for i in range(Ntot):
x=r.nextGaussian()
b.add(x)
print ' CPU time for Java ArrayList (s)=',time.clock()-start