Commits

Matthew Turk committed 0b651f4

Moved a few things into the constants. Now I need to learn some Go idioms and
make this code more in line with the Go spirit.

Comments (0)

Files changed (1)

 )
 
 const (
-
+    NSIDE int = 8192
+    NRUN int = 1
 )
 
 type PixelArray struct {
     pixels.Pdx = FillElements(f, "pdx")
     pixels.Pdy = FillElements(f, "pdy")
     pixels.Vals = FillElements(f, "Density_Density")
-    img := NewImageBuffer(1024, 1024, 0.0, 1.0, 0.0, 1.0)
+    img := NewImageBuffer(NSIDE, NSIDE, 0.0, 1.0, 0.0, 1.0)
     t1 := time.Now()
-    N := 100
-    for i := 0; i < N; i++ {
+    for i := 0; i < NRUN; i++ {
         img.Fill(pixels)
     }
     dt := time.Since(t1)
-    spf := dt.Seconds() / float64(N)
+    spf := dt.Seconds() / float64(NRUN)
     fps := 1.0 / spf
     fmt.Printf("Took %0.3e seconds each call for %0.3e fps\n", spf, fps)
     var mi, ma = 1e30, -1e30