= #JxnPortable\docs\programmer_examples\UsingJavaAPI_2_System.jxn

start = System.currentTimeMillis()
Thread.sleep( 1000 )
System.currentTimeMillis() - start

start = System.nanoTime()
! generate 10 Mio. gaussian distributed random numbers:
n = 10_000_000
n = KmgLinSkal.floor125( Runtime.getRuntime().maxMemory() / 32 ).intValue()
z = JxnRealArrayAlgebra.noise( n )
0.000_000_001 ( System.nanoTime() - start )

start = System.currentTimeMillis()
y = sort z
0.001 ( System.currentTimeMillis() - start )

plot( y.range( 0, 50 ) ).setPlotFrameTitle( "smallest values of the distribution" )
plot( y.range( n / 2 - 5000, n / 2 + 5000 ) ).setPlotFrameTitle( "values near the median of the distribution" )
! plotting all values takes some time:
! plot( y )